我目前在serverless.yml上使用它来实现CORS
provider:
httpApi:
Ref: httpApiCustom
functions:
login:
name: 'login'
events:
- httpApi: POST /login
resources:
Resources:
httpApiCustom:
Type: AWS::ApiGatewayV2::Api
Properties:
Name: api-name
ProtocolType: HTTP
CorsConfiguration:
AllowOrigins:
- '*'
httpApiCustomStage:
Type: AWS::ApiGatewayV2::Stage
Properties:
ApiId:
Ref: httpApiCustom
StageName: ${self:provider.stage}
但是似乎它没有引用cloudformation,而是创建了2个API,一个API包含没有CORS的路由,另一个API包含了CORS但没有路由。有什么想法吗?