|
5 | 5 | ```yml
|
6 | 6 | # serverless.yml
|
7 | 7 |
|
8 |
| -component: express-tencent@dev # (required) name of the component. In that case, it's express. |
9 |
| -name: express-api # (required) name of your express component instance. |
10 |
| -org: test # (optional) serverless dashboard org. default is the first org you created during signup. |
11 |
| -app: expressApp # (optional) serverless dashboard app. default is the same as the name property. |
| 8 | +component: express # (required) name of the component. In that case, it's express. |
| 9 | +name: expressDemo # (required) name of your express component instance. |
| 10 | +org: orgDemo # (optional) serverless dashboard org. default is the first org you created during signup. |
| 11 | +app: appDemo # (optional) serverless dashboard app. default is the same as the name property. |
12 | 12 | stage: dev # (optional) serverless dashboard stage. default is dev.
|
13 | 13 |
|
14 | 14 | inputs:
|
15 | 15 | region: ap-guangzhou
|
16 |
| - functionName: express-api |
| 16 | + functionName: expressDemo |
17 | 17 | serviceName: mytest
|
18 |
| - runtime: Nodejs8.9 |
| 18 | + runtime: Nodejs10.15 |
19 | 19 | serviceId: service-np1uloxw
|
20 | 20 | src: ./src
|
| 21 | + layers: |
| 22 | + - name: expressLayer |
| 23 | + version: 1 |
21 | 24 | functionConf:
|
22 | 25 | timeout: 10
|
23 | 26 | memorySize: 128
|
@@ -60,26 +63,35 @@ Main param description
|
60 | 63 |
|
61 | 64 | | Param | Required | Default | Description |
|
62 | 65 | | ---------------------------------------- | :------: | :-------------: | :------------------------------------------------------------------------------------------ |
|
63 |
| -| runtime | N | Nodejs8.9 | Function Runtime, support: Nodejs6.10, Nodejs8.9, Nodejs10.15 | |
| 66 | +| runtime | N | Nodejs10.15 | Function Runtime, support: Nodejs6.10, Nodejs8.9, Nodejs10.15 | |
64 | 67 | | region | N | ap-guangzhou | Deploy region |
|
65 | 68 | | functionName | N | | Serverless Cloud Function Name |
|
66 | 69 | | serviceName | N | | API-Gateway service name, default to create a new serivce |
|
67 | 70 | | serviceId | N | | API-Gateway service id, if it has will use this APII-Gateway service |
|
68 | 71 | | src | N | `process.cwd()` | Default is current working directory, if it is object, refer to [code object](#code-object) |
|
| 72 | +| layers | N | | Bind layers for scf, array of [Layer](#layer) | |
69 | 73 | | exclude | N | | exclude file |
|
70 | 74 | | include | N | | include file, if relative path, should relative to `serverless.yml` |
|
71 | 75 | | [functionConf](#funtionConf) | N | | Function configure |
|
72 | 76 | | [apigatewayConf](#apigatewayConf) | N | | API-Gateway configure |
|
73 | 77 | | [cloudDNSConf](#cloudDNSConf) | N | | Special config for region |
|
74 | 78 | | [Region special config](#apigatewayConf) | N | | Special config for region. Use region name for key |
|
75 | 79 |
|
76 |
| -## code object |
| 80 | +## src object |
77 | 81 |
|
78 | 82 | | Param | Required | Type | Default | Description |
|
79 | 83 | | ------ | :------: | :----: | :-----: | :----------------- |
|
| 84 | +| src | N | String | | code path | |
80 | 85 | | bucket | N | String | | bucket name |
|
81 | 86 | | object | N | String | | bucket object name |
|
82 | 87 |
|
| 88 | +## layer |
| 89 | + |
| 90 | +| Param | Required | Type | Default | Description | |
| 91 | +| ------- | :------: | :----: | :-----: | :------------ | |
| 92 | +| name | N | String | | layer name | |
| 93 | +| version | N | String | | layer version | |
| 94 | + |
83 | 95 | ### cloudDNSConf
|
84 | 96 |
|
85 | 97 | Refer to: https://cloud.tencent.com/document/product/302/8516
|
|
0 commit comments