This repo demonstrates deploying and running a GraphQL server as a serverless function via AWS Lambda, Azure Functions, and Google Cloud Functions.
Warning: This demo is partially broken on Windows. Running the local server and deploying to Google should work.
- Node.js 8+
- A running MongoDB instance. MongoDB Atlas has a great free option.
- This repo cloned to your computer.
This project requires a MongoDB instance
npm run db:seed
Serverless uses credentials specific to each cloud provider to authenticate during deployment. See the Serverless Docs for walkthroughs on setting up your credentials:
All depencencies are managed at the root of the repo. Run the following command to install dependencies:
Services for each provider can be deployed as a group or individually. Run the following command to deploy all services:
The following scripts are available via npm scripts.
Runs a local Express server with the same configuration as the cloud provider functions.
Delete the data in MongoDB.
Resets the database by running
npm run db.drop then
npm run db.seed.
Create seed data in MongoDB.
Deploys functions to all providers.
Deploys functions to AWS.
Deploys functions to Azure.
Deploys functions to Google Cloud.
Removes functions from all providers.
Removes functions from AWS.
Removes functions from Azure.
Removes functions from Google Cloud.