Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

MongoDB example

A simple note app using tinyhttp and MongoDB.

Setup

Install dependencies

tinyhttp new mongodb

Create a database

Go to MongoDB Atlas, create a new database and grab the URI string, then put DB_URI=<URI> in the .env file.

Run

node index.js

Endpoints

  • GET /notes - list notes with 2 properties which are title and desc.

  • POST /notes - create a post using the data from title and desc query

  • DELETE /notes - delete a note with specified ID

  • PUT /notes - update a note by ID