Skip to content

Latest commit

 

History

History
65 lines (46 loc) · 2.04 KB

README.md

File metadata and controls

65 lines (46 loc) · 2.04 KB

#Node, Express and Sequelize Rest-API boiler plate with database

This is a straight forward boiler plate to build Rest API with express and sequelize to connect and fetch data from sqlite database. It also contains token based user authentication

Third party node package managers used

Getting started

//git clone
git clone https://github.com/arorarahul/node-restful-api.git

//move to the required directory
cd node-restful-api

//install all the dependencies 
npm install

How ro run?

//start server and build database schema
node server.js

//use postman or any other tool to access APIs namely

//create user by passing 'email' and 'password' in json format
POST localhost:3000/users

//login user by passing 'email' and 'password' for created user. Save the auth token returned in the remaining
//get, post and put calls
POST localhost:3000/users/login

//Auth token required in headers with key 'Auth'
//create todos by passing 'description' and 'completed' (boolean) in this call as JSON
POST localhost:3000/todos

//Auth token required in headers with key 'Auth'
//GET user specific todos
GET localhost:3000/todos

//Auth token required in headers with key 'Auth'
//GET user specific todos by todo id
GET localhost:3000/todos/:id

//Auth token required in headers with key 'Auth'
//Update user specific todos by todo id
PUT localhost:3000/todos/:id

//Auth token required in headers with key 'Auth'
//Delete user specific todos by todo id
DELETE localhost:3000/todos/:id

//Auth token required in headers with key 'Auth'
//logout
DELETE localhost:3000/user/login