Skip to content

do-community/node-express-api

Repository files navigation

Node Fastify API

This is a demo application for building a Node API. In this demo, we will do CRUD operations on Tweets.

Node APIs and MongoDB go hand-in-hand. This demo app uses:

Routes

The routes for this app are:

  • GET /tweets: Get all tweets
  • POST /tweets: Create a tweet
  • GET /tweets/<tweet_id>: Get a single tweet
  • PUT /tweets/<tweet_id>: Update a tweet
  • DELETE /tweets/<tweet_id>: Delete a tweet

Deploying to DigitalOcean

Deploy to DO

How to Deploy

This demo can be deployed using the 1-click button above. If you want to deploy this to your DigitalOcean App Platform, follow these steps:

  1. Fork this repo so you have this on your GitHub account
  2. Create a MongoDB Database
  3. Login to your DigitalOcean App Platform Dashboard
  4. Click Create App
  5. Search for your GitHub repo
  6. Remove the npm run build command from the build setup
  7. Link the MongoDB database you just created
  8. Follow the steps to deploy
  9. Add your MongoDB DATABASE_URL to your environment variables
  10. Add your MongoDB CA_CERT to your environment variables

Adding a MongoDB Database

  1. Login to your DigitalOcean account
  2. Go to Create -> Database
  3. Create a MongoDB Database
  4. Grab the connection URL
  5. Add an environment variable in App Platform called DATABASE_URL

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published