Skip to content

Starter project for restful-api with token based authentication using node, express and sequelize

Notifications You must be signed in to change notification settings

arorarahul/node-restful-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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

About

Starter project for restful-api with token based authentication using node, express and sequelize

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published