-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
48 lines (44 loc) · 1.21 KB
/
serverless.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
service: gateway-cors
package:
individually: true
provider:
name: aws
stage: test
runtime: nodejs18.x
region: eu-west-1
versionFunctions: false
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: 1
STAGE: ${self:provider.stage}
apiGateway:
minimumCompressionSize: 0
functions:
health:
handler: index.healthHandler
memorySize: 128
timeout: 20
events:
- http:
method: GET
path: health/{any+}
cors: true
resources:
- Resources:
GatewayResponseDefault4XX:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: DEFAULT_4XX
RestApiId:
Ref: 'ApiGatewayRestApi'
GatewayResponseDefault5XX:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: DEFAULT_5XX
RestApiId:
Ref: 'ApiGatewayRestApi'