Skip to content

akhila-ariyachandra/serverless-graphql-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless GraphlQL API Example

Example Deployment

A serverless GraphQL API built with TypeScript and MongoDB

The explaination of the API can my found on my blog.

Local Development

The Vercel CLI will need be downloaded, installed and logged into.

After that create a .env file and add the DB_PATH environment variable with the database URI.

DB_PATH=mongodb://<user>:<password>@ds123456.mlab.com:54321/example-db

Then link it to a Vercel project.

vercel link

Finally run

vercel dev

Deploying to Vercel

First upload the database path as an Environment Variable.

vercel env add

Name the variable DB_PATH and make sure you make to available for all three environments (Production, Preview and Development).

Then all that’s left to do is to deploy to Vercel.

vercel

About

A serverless GraphQL API built with TypeScript and MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published