-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yaml
53 lines (48 loc) · 1.51 KB
/
serverless.yaml
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
# Ref:
# https://github.com/serverless-components/tencent-scf/blob/master/docs/configure.md.
# https://github.com/serverless/serverless-tencent/discussions/22
# https://github.com/serverless/serverless-tencent/blob/master/docs/basic/variables.md
#
#应用组织信息
app: 'xadmin' # 应用名称。留空则默认取当前组件的实例名称为app名称。
#stage: 'test' # 环境名称。默认值是 dev。建议使用${env:STAGE}变量定义环境名称
stage: ${env:STAGE} # 环境名称。默认值是 dev。建议使用${env:STAGE}变量定义环境名称
component: scf
name: api
inputs:
src:
src: ./
hook: "ls"
exclude:
- .env
- .env.test
- .env.release
- .vscode
namespace: ${env:SCF_NAMESPACE}
region: ap-shanghai
runtime: Go1
handler: main
memorySize: 64 # 内存大小,单位MB
timeout: 5 # 函数执行超时时间,单位秒
initTimeout: 3 # 初始化超时时间,单位秒
environment: # 环境变量
variables: # 环境变量对象
ENV: ${stage}
publicAccess: true # 是否开启公网访问
events:
- apigw:
parameters:
serviceName: serverless
serviceId: ${env:SCF_SERVICE_ID}
protocols:
- http
- https
environment: ${stage}
endpoints:
- path: /
apiName: ${name}
method: ANY
enableCORS: true
function:
isIntegratedResponse: true
functionQualifier: $DEFAULT