Skip to content

Latest commit

 

History

History
90 lines (74 loc) · 2.68 KB

README.md

File metadata and controls

90 lines (74 loc) · 2.68 KB

NodeJS Simple-CRUD

This repo use for mentoring nodejs and reactjs integration api training

Installing Sequelize CLI

 npm i -g sequelize-cli

Setup Project

  1. clone this project and move to project directory
  2. install all the dependencies required:
npm install or yarn install
  1. Create .env file (copy .env.example and fill it)
  2. Create config.json on config/ directory (copy config.json.example and fill it)
  3. Use the sequelize-cli command for database migration :
 npx sequelize-cli db:migrate
  1. Run this Project
 npm start or yarn start
  1. Finish

API Reference

Get all users

  GET /api/users
Query Parameter Type Description
page integer page of data
search string search data by email or firstName
sortBy string sortBy email or firstName
sort string sort ASC or DESC

Get user

  GET /api/users/${uuid}
Parameter Type Description
uuid string Required. uuid of user to fetch

Store user

  POST /api/users
Body Parameter Type Description
firstName string Required. firstName of store user
lastName string Required. lastName of store user
email string Required. email of store user
address string Required. address of store user
phone integer Required. phone of store user

Update user

  PUT /api/users/${uuid}
Parameter Body Parameter Type Description
uuid - string Required. uuid for find user
- firstName string Optional. firstName of store user
- lastName string Optional. lastName of store user
- email string Optional. email of store user
- address string Optional. address of store user
- phone integer Optional. phone of store user

Delete user

  DELETE /api/users/${uuid}
Parameter Body Parameter Type Description
uuid - string Required. uuid for find user

License

MIT