- Create database with these names:
todo_dev
todo_production
- Install global dependency:
npm i -g sequelize-cli # or yarn global add sequelize-cli
- Install local dependencies:
npm i # or yarn
- Edit
.env
Without migrations
npm start
# or
yarn start
Without migrations
sequelize db:migrate
npm start
# or
sequelize db:migrate
yarn start
Access API server by opening http://localhost:8000
/users
Endpoint | HTTP | Description | Body |
---|---|---|---|
/users/ |
GET | Get all users | - |
/users/ |
POST | Create user | name , age |
/users/:userId |
GET | Get user by id | - |
/users/:userId |
PATCH | Update user by id | name , age |
/users/:userId |
DELETE | DELETE user by id |