forked from jpstrikesback/cloudflare-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
38 lines (35 loc) · 1.08 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
# serverless.yml
service:
name: hello-stuff
custom:
webpack:
webpackConfig: 'webpack.config.js' # Name of webpack configuration file
includeModules: true # Node modules configuration for packaging
packager: 'yarn' # Packager that will be used to package your external modules
provider:
name: cloudflare
config:
accountId: ${env:CLOUDFLARE_ACCOUNT_ID}
zoneId: ${env:CLOUDFLARE_ZONE_ID}
namespaceId: ${env:CLOUDFLARE_NAMESPACE_ID}
workers:
hello:
routes:
- example.com/graphql
plugins:
- serverless-webpack
- serverless-cloudflare-workers
functions:
helloStuff:
handler: src/helloStuff/index.server
# What the script will be called on Cloudflare
worker: hello
# The name of the script on your machine, omitting the .js file extension
script: src/helloStuff/index
# Events are only relevant to the `serverless invoke` command and don’t affect deployment in any way
events:
- http:
url: example.com/graphql
method: POST
headers:
someKey: someValue