This repository has been archived by the owner on Mar 5, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathserverless.yml
71 lines (63 loc) · 2.18 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
service:
name: serverless-with-next
frameworkVersion: ">=1.26.1"
plugins:
- serverless-webpack
- serverless-offline
- serverless-jest-plugin
- serverless-domain-manager
# Enable auto-packing of external modules
# See https://serverless-stack.com/chapters/add-support-for-es6-es7-javascript.html
custom:
serverless-offline:
port: 3000 # We run our SLS endpoints on another port (Next app will run on 3001)
webpackIncludeModules: true
domains:
enabled_development: false
url_development: '' # Unused, just avoid SLS warning variable not found
enabled_staging: true # TODO Pass this to false if you don't want to use a custom domain (custom domain is currently recommended because it fixes sub routes, but not really if you just wanna play around, see "Known issues")
url_staging: 'swn.dev.vadorequest.fr'
enabled_production: true
url_production: 'swn.prod.vadorequest.fr' # TODO change
memorySizes: # TODO Check how much is actually needed
development: 512 # Unused, just avoid SLS warning variable not found
staging: 512
customDomain:
enabled: ${self:custom.domains.enabled_${self:provider.stage}}
domainName: ${self:custom.domains.url_${self:provider.stage}}
# basePath: '' # This will be prefixed to all routes
stage: ${self:provider.stage}
createRoute53Record: true
provider:
name: aws
runtime: nodejs6.10
timeout: 30 # 30 seconds is the maximal allowed by API Gateway
stage: ${opt:stage, 'development'}
region: ${opt:region, 'us-east-1'}
memorySize: ${self:custom.memorySizes.${self:provider.stage}}
environment:
NODE_ENV: ${self:provider.stage}
#package:
# individually: true
functions:
server:
handler: src/functions/server/server.handler
events:
- http:
method: GET
path: /
- http:
method: GET
path: /static/{any+}
- http:
method: GET
path: /_next/{proxy+} # Catch Next specific routes
- http:
method: ANY
path: /{any+} # Catch all unknown routes and redirect to main handler
status:
handler: src/functions/status/status.handler
events:
- http:
method: get
path: status