Here i was built the Simple Note App which specially for backend only and this project is the development of the previous version simple-note-app
- node_modules
- Postman
- Web Server (ex. localhost)
- Open CMD or Terminal and enter to the app directory
- Type
npm install
- Make a new file with name .env in the root directory, set up first here
- Turn on Web Server and database (for example :MySQL as database and xampp as web server) you can using Third-party tool.
- Run command in CMD r Terminal to migrate database with
sequelize db:migrate
- Open Postman desktop application or Chrome web app extension that has installed before
- Choose HTTP Method and enter request url.(ex. localhost:3002/notes)
- You can see all the end point here
Open .env file on your favorite code editor, and copy paste this code below :
NODE_ENV=development
PORT= // fill with your port
DB_HOST=localhost
DB_USER=root // default
DB_PASS= // default
DB_NAME=task_week1_with_model_sequelize
1. GET
/note
//note/:idNote
(Get notes by id)/category
/category/:idCategory
(Get category by id)/notes?idCategory=
(Get notes by category id)/notes?search=
(Search operation by title)/notes?sort=
(Sort operation) // fill with asc or desc/notes?page=
(Paging for limiting notes) // fill only with integer
2. POST
/note
/category
3. PATCH
/note/:idNote
(Update notes by id)/category/:idCategory
(Update category by id)
4. DELETE
/notes/:idNote
(Delete notes by id)/category/:idCategory
(Delete category by id)