This repo is about how to create a rest API for beginners using MVC pattern.
Database: Mongodb
Server: Node, Express, Mongoose
Clone the project
git clone https://github.com/B-chandru/rest_Api.git
Go to the project directory
cd rest_Api
Install dependencies
npm install
Start the server
npm run dev
To run this project, you will need to add the following environment variables to your .env file
PORT=5000
MONGODB=mongodb://localhost:27017/restapi
http://localhost:5000/app/
http://localhost:5000/app/:id
http://localhost:5000/app/
for post request the json formate should be like this :
{
"title":"my first api",
"content":"how to create an api"
}
PUT http://localhost:5000/app/:id
{
"msg": "updated the msg"
}
DELETE http://localhost:5000/app/:id
{
"msg": "deleted the msg"
}