A simple REST API for creating, reading , updating and deleting (CRUD) blog posts in a MongoDB database.
Elia Tryfonas
- Node.js
- Express
- MongoDB
- Mongoose
To run this project create a .env file and add
DB_CONNECTION ='your-mongodb-connection-url'
then
npm install
npm run start
You can send requests to the following endpoints to interact with the database.
For POST you need to provide the following in the request body and for PATCH only what you want to update.
{
"title":"Your Title",
"body":"Your content"
}
GET
/blogs
Retrieve all posts stored in the database.
/blogs/id
Retrieve a specific post.
POST
/blogs/id
Submit a new post.
PATCH
/blogs/id
Update data of a specific post.
DELETE
/blogs/id
Delete a post.
This project is licensed under the MIT License.