-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
47 lines (47 loc) · 1.12 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
service: opusdb-graphql
app: opus-graphql
tenant: gtwright
plugins:
- serverless-webpack
- serverless-offline
custom:
webpack:
webpackConfig: ./webpack.config.js
includeModules: true
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:stage,'dev'}
environment: ${file(secrets.yml):${self:provider.stage}}
functions:
graphql:
handler: src/index.handler
events:
- http:
path: graphql
method: post
credentials: true
preflightContinue: true
cors:
origin: '*' # <-- Specify allowed origin
headers: # <-- Specify allowed headers
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
- apollographql-client-name
- apollographql-client-version
playground:
handler: src/index.handler
events:
- http:
path: playground
method: get
cron:
handler: src/cron.run
events:
- schedule:
rate: rate(1 hour)
enabled: ${env:CRON}