Skip to content

Starter project for a REST API with Node.js, Express & MongoDB

Notifications You must be signed in to change notification settings

trionoputra/express-mongoose-rest-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Express Mongoose REST API

Starter project for a REST API with Node.js, Express & MongoDB

Prerequisites

Dependencies

Installation

$ git clone https://github.com/trionoputra/express-mongoose-rest-api.git
$ cd express-mongoose-rest-api
$ npm install
$ npm start

Routes

GET http://localhost:3000/user

Get all users.

  • Method: GET
  • URL: http://localhost:3000/user

POST http://localhost:3000/user

Create a new user.

  • Method: POST
  • URL: http://localhost:3000/user
  • Body:
{
  "id": "1",
  "name": "Trionoputra"
  "password": "123456"
}

GET http://localhost:3000/user/:userId

Get user with specific id.

  • Method: GET
  • URL: http://localhost:3000/user/1

PUT http://localhost:3000/user/:userId

Update entire user with specific id.

  • Method: PUT
  • URL: http://localhost:3000/user/1
  • Body:
{
  "name": "Triono putra"
  "password": "1234567890"
}

DELETE http://localhost:3000/user/:userId

Delete user with specific id.

  • Method: DELETE
  • URL: http://localhost:3000/user/1

Releases

No releases published

Packages

No packages published