./multi-scf-demo├── index│ ├── index.js # Main function 1│ ├── package.json│ └── scf_bootstrap # Bootstrap file for HTTP-triggered functions, which can be ignored for event-triggered functions├── user│ ├── index.js # Main function 2│ ├── package.json│ └── scf_bootstrap # Bootstrap file for HTTP-triggered functions, which can be ignored for event-triggered functions└── serverless.yml # YML configuration file
serverless.yml
file and configure relevant parameters for your project by referring to the following sample YML. For more configuration content, please see Full Configuration.app: multi-scf # Application namecomponent: multi-scf # Component type, which is `multi-scf` herename: web_demo # Customizable instance nameinputs:src:# The code directory must be specified here, and SCF will automatically split the function code according to the function configurationsrc: ./exclude:- .envregion: ap-guangzhou # Regionruntime: Nodejs12.16 # Function language versionmemorySize: 512timeout: 3type: web # Function type, which is HTTP-triggered function herefunctions:index:src: ./index # Entry function of function 1handler: scf_bootstrap # Bootstrap fileuser:src: ./user # Entry function of function 2handler: scf_bootstrap # Bootstrap filetriggers: # Trigger configuration- type: apigwparameters:name: serverlessprotocols:- https- httpapis:- path: /method: ANY# The API function configuration has a higher priority than the outer functionfunction: index- path: /usermethod: ANY# The API function configuration has a higher priority than the outer functionfunction: user
sls deploy
in the root directory to test whether the project is successfully deployed.Parameter | Description |
Basic configuration parameter list | Basic configuration parameter list |
Advanced configuration parameter list | Optional |
Application name, overview, documentation link, and tag | For block display in the console |
Was this page helpful?