-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
65 lines (64 loc) · 1.88 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
org: slsplus
app: shorten-urls
stage: dev
component: express
name: shorten-urls
inputs:
functionName: ${name}
region: ${env:REGION}
runtime: Nodejs12.16
src:
src: ./dist
exclude:
- .env
- '.git/**'
- 'docs/**'
- '__tests__/**'
- 'typings/**'
- '.github/**'
- 'node_modules/**'
layers:
- name: ${output:${stage}:${app}:${name}-layer.name}
version: ${output:${stage}:${app}:${name}-layer.version}
functionConf:
timeout: 120
vpcConfig:
vpcId: ${output:${stage}:${app}:${app}-vpc.vpcId}
subnetId: ${output:${stage}:${app}:${app}-vpc.subnetId}
environment:
variables:
NODE_ENV: production
SERVERLESS: true
STATIC_URL: ${output:${stage}:${app}:${app}-cos.url}
DB_HOST: ${output:${stage}:${app}:${app}-db.private.host}
DB_PORT: ${output:${stage}:${app}:${app}-db.private.port}
DB_NAME: ${output:${stage}:${app}:${app}-db.private.dbname}
DB_USER: ${output:${stage}:${app}:${app}-db.private.user}
DB_PASSWORD: ${output:${stage}:${app}:${app}-db.private.password}
apigatewayConf:
serviceName: shorten_urls
serviceTimeout: 120
protocols:
- http
- https
function:
functionQualifier: $DEFAULT
# if you want to config custom domains for Tencent Cloud API Gateway, just config as below.
# Because I using my own generic domain ssl, so configured with Nginx server.
# customDomains:
# - domain: url.sls.plus
# certificateId: iuenkIk
# isDefaultMapping: false
# pathMappingSet:
# - path: /
# environment: release
# protocols:
# - https
# - domain: u.sls.plus
# certificateId: Dlkdjkl
# isDefaultMapping: false
# pathMappingSet:
# - path: /
# environment: release
# protocols:
# - https