#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
- bcrypt to support password hashing for user authentication
- Body parsing via body-parser
- cypto-js and jsonwebtoken to support token based authentication
- sqlite3 and sequelize to support database integration
//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
//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