Skip to content

This repo is about how to create a rest API for beginners using MVC pattern.

Notifications You must be signed in to change notification settings

B-chandru/rest_Api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rest_Api

This repo is about how to create a rest API for beginners using MVC pattern.

Tech Stack

Database: Mongodb

Server: Node, Express, Mongoose

Run Locally

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

Environment Variables

To run this project, you will need to add the following environment variables to your .env file

PORT=5000

MONGODB=mongodb://localhost:27017/restapi

API Reference

Get all items

   http://localhost:5000/app/

Get items by id

   http://localhost:5000/app/:id

post

   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

  PUT http://localhost:5000/app/:id

if the put request is successful then you get this as a response

  {
  "msg": "updated the msg"
   }

Delete

  DELETE  http://localhost:5000/app/:id

if the delete request is successful then you get this as a response

 
{
  "msg": "deleted the msg"
}

About

This repo is about how to create a rest API for beginners using MVC pattern.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published