分支类型 | 说明 |
master | 用于生产环境部署 |
testing | 用于测试环境测试 |
dev | 用于日常开发 |
feature-xxx | 用于增加一个新功能,例如不同开发者会从 dev 拉取不同的特性分支进行开发 |
hotfix-xxx | 用于修复一个紧急 bug |
#serverless.ymlapp: expressDemoApp # 应用名称,默认为与组件实例名称stage: ${env:STAGE} # 用于开发环境的隔离,默认为devcomponent: express # (必填) 引用 component 的名称,当前用到的是 express-tencent 组件name: expressDemo # (必填) 组件创建的实例名称inputs:src:src: ./exclude:- .envregion: ap-guangzhouruntime: Nodejs10.15functionName: ${name}-${stage}-${app} #云函数名称apigatewayConf:protocols:- http- httpsenvironment: release
TENCENT_SECRET_ID=xxxxxxxxxx #您账号的 SecretIdTENCENT_SECRET_KEY=xxxxxxxx #您账号的 SecretKeySTAGE=prod #STAGE为prod环境,也可以sls deploy --stage prod 参数传递的方式设置
// Routesapp.get(`/feature`, (req, res) => {res.sendFile(path.join(__dirname, 'feature.html'))})
<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Serverless Component - Express.js</title></head><body><h1>This is a new feature 1.</h1></body></html>
TENCENT_SECRET_ID=xxxxxxxxxxTENCENT_SECRET_KEY=xxxxxxxxSTAGE=feature1
region: ap-guangzhouapigw:serviceId: service-xxxxxxsubDomain: service-xxxxxx-123456789.gz.apigw.tencentcs.comenvironment: releaseurl: https://service-xxxxxx-123456789.gz.apigw.tencentcs.com/release/scf:functionName: express-demo-feature1runtime: Nodejs10.15namespace: defaultlastVersion: $LATESTtraffic: 1Full details: https://serverless.cloud.tencent.com/instances/expressDemoApp%3Afeature1%3AexpressDemo10s » expressDemo » Success
TENCENT_SECRET_ID=xxxxxxxxxxTENCENT_SECRET_KEY=xxxxxxxxSTAGE=dev
TENCENT_SECRET_ID=xxxxxxxxxxTENCENT_SECRET_KEY=xxxxxxxxSTAGE=testing
TENCENT_SECRET_ID=xxxxxxxxxxTENCENT_SECRET_KEY=xxxxxxxxSTAGE=prod
sls deploy
本页内容是否解决了您的问题?