-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless-test.yml
63 lines (57 loc) · 1.62 KB
/
serverless-test.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
service: sls-router-sample-simple
provider:
name: aws
runtime: nodejs14.x
memorySize: 128
timeout: 30
stage: 'sample'
region: us-east-1
lambdaHashingVersion: 20201221
apiGateway:
shouldStartNameWithService: true
environment:
STAGE: ${self:provider.stage}
JWT_ISSUER: ${file(./test/src/.env.yml):${self:provider.stage}.JWT_ISSUER}
JWT_SECRET: ${file(./test/src/.env.yml):${self:provider.stage}.JWT_SECRET}
functions:
app:
handler: test/src/server.handler
events:
- http:
path: /
method: ANY
cors: true
- http:
path: /{proxy+}
method: ANY
cors: true
resources:
Resources:
# This response is needed for custom authorizer failures cors support ¯\_(ツ)_/¯
GatewayResponse:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: EXPIRED_TOKEN
RestApiId:
Ref: 'ApiGatewayRestApi'
StatusCode: '401'
AuthFailureGatewayResponse:
Type: 'AWS::ApiGateway::GatewayResponse'
Properties:
ResponseParameters:
gatewayresponse.header.Access-Control-Allow-Origin: "'*'"
gatewayresponse.header.Access-Control-Allow-Headers: "'*'"
ResponseType: UNAUTHORIZED
RestApiId:
Ref: 'ApiGatewayRestApi'
StatusCode: '401'
plugins:
- serverless-offline
custom:
serverless-offline:
host: 0.0.0.0
httpPort: 8080
noPrependStageInUrl : true