https://github.com/eliacontini/todo-api-heroku
A simple REST API to manage todos. Playground to test Fastify, MongoDB Atlas and Heroku.
https://github.com/eliacontini/todo-api-heroku
fastify heroku mongodb-atlas mongoose nodejs rest-api
Last synced: about 2 months ago
JSON representation
A simple REST API to manage todos. Playground to test Fastify, MongoDB Atlas and Heroku.
- Host: GitHub
- URL: https://github.com/eliacontini/todo-api-heroku
- Owner: EliaContini
- Created: 2021-04-05T14:51:12.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-05-16T14:27:44.000Z (about 5 years ago)
- Last Synced: 2025-04-05T00:42:48.265Z (about 1 year ago)
- Topics: fastify, heroku, mongodb-atlas, mongoose, nodejs, rest-api
- Language: JavaScript
- Homepage: https://elia.contini.page/blog/fastify-mongodb-heroku-rest-api/
- Size: 181 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A simple REST API to manage todos using Fastify, MongoDB and Heroku
This solution uses [Fastify](https://www.fastify.io/), [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) and it is configured to be deployed on [Heroku](https://www.heroku.com/).
You can read more details about the implementation in my [blog post](https://elia.contini.page/blog/fastify-mongodb-heroku-rest-api/).
## Install dependencies
$ npm install
## Configure MongoDB URI for local development
Copy `sample.env` in `.env` and edit with your MONGODB_URI.
## Run the server
$ npm start
The server listens to connections at http://localhost:3000
## Run the tests
$ npm test
## Deployment on Heroku
Login with your Heroku account
$ heroku login
Create the app
$ heroku create
Set environment variable with MongoDB Atlas connection string
$ heroku config:set MONGO_DB_URI="mongodb+srv://:@.mongodb.net/"
Deploy
$ git push heroku master