Skip to content

Instantly share code, notes, and snippets.

@lewisdaly
Last active July 23, 2018 10:31
Show Gist options
  • Save lewisdaly/bb323745f4d8c6b06606b2872096ccd3 to your computer and use it in GitHub Desktop.
Save lewisdaly/bb323745f4d8c6b06606b2872096ccd3 to your computer and use it in GitHub Desktop.
Apollo Server + Serverless setup guide
#install global nodeyness
npm install -g serverless
serverless create --template aws-nodejs --path al_serverless
cd al_serverless
#local dependencies for apollo and stuff
npm install --save apollo-server-lambda graphql-tools lodash
service: apollo-lambda
provider:
name: aws
runtime: nodejs6.10
region: ap-southeast-2
stage: development
functions:
graphql:
handler: handler.graphql
events:
- http:
path: graphql
method: post
cors: true
graphiql:
handler: handler.graphiql
events:
- http:
path: graphiql
method: get
@AyoubEd-zz
Copy link

And then, how to write your handler,
Any examples would be awesome !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment