我想使用无服务器框架和 AWS 设置自定义域。
这就是我在 serverless.yml 中的内容
service: chapiLabs-rest-api
plugins:
- serverless-domain-manager
- serverless-express
custom:
customDomain:
domainName: chapitime.chapilabs.com
basePath: ''
stage: ${self:provider.stage}
certificateName: '*.chapilabs.com'
createRoute53Record: true
package:
exclude:
- node_modules
include:
- dist
provider:
name: aws
runtime: nodejs8.10
webpackIncludeModules:
forceInclude:
- mysql
- mysql2
- sequelize
functions:
get:
handler: dist/get.get
events:
- http:
path: v1/client/{id}
method: get
request:
parameters:
paths:
id: true
create:
handler: dist/auth.auth
events:
- http:
path: v1/auth
method: post
Run Code Online (Sandbox Code Playgroud)
我使用这个 npm 包作为插件:https : //github.com/amplify-education/serverless-domain-manager
我使用 CloudFlare 通过 …