Last active
July 23, 2018 10:31
-
-
Save lewisdaly/bb323745f4d8c6b06606b2872096ccd3 to your computer and use it in GitHub Desktop.
Apollo Server + Serverless setup guide
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
And then, how to write your handler,
Any examples would be awesome !