https://github.com/andreferi3/expressjs-simple-note-app-restful-api
https://github.com/andreferi3/expressjs-simple-note-app-restful-api
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/andreferi3/expressjs-simple-note-app-restful-api
- Owner: andreferi3
- Created: 2019-06-18T06:27:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T19:26:38.000Z (over 3 years ago)
- Last Synced: 2023-03-03T01:19:09.467Z (over 3 years ago)
- Language: JavaScript
- Size: 89.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ExpressJS - Simple Note App RESTful API
## Table of contents
* [Introduction](#introduction)
* [Requirements](#requirements)
* [How to run the app ?](#how-to-run-the-app-)
* [Set up .env file](#set-up-env-file)
* [End Point List](#end-point-list)
## Introduction
[](https://expressjs.com/en/starter/installing.html)
[](https://nodejs.org/)
Here i was built the Simple Note App which specially for backend only.
Express.js, or simply Express, is a web application framework for Node.js. [More about Express](https://en.wikipedia.org/wiki/Express.js)
## Requirements
1. node_modules
2. Postman
3. Web Server (ex. localhost)
## How to run the app ?
1. Open CMD or Terminal and enter to the app directory
2. Type `npm install`
3. Make a new file called **.env** in the root directory, set up first [here](#set-up-env-file)
4. Turn on Web Server and MySQL can using Third-party tool like xampp, etc.
5. Import file [simple_note_app.sql](simple_note_app.sql) to **phpmyadmin**
6. Open Postman desktop application or Chrome web app extension that has installed before
7. Choose HTTP Method and enter request url.(ex. localhost:3000/notes)
8. You can see all the end point [here](#end-point-list)
## Set up .env file
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=simple_note_app
```
## End Point List
**1. GET**
* `/notes`
* `/notes/:id` (Get notes by id)
* `/category`
* `/category/:id` (Get category by id)
* `/notes/category/:id` (Get notes by category id)
* `/all-notes` (Get all notes with category name)
* `/notes?search=note_title` (Search operation)
* `/notes?sort=` (Sort operation) // fill with asc or desc
* `/notes?page=` (Paging for limiting notes) // fill only with integer
**2. POST**
* `/notes`
* `/category`
**3. PATCH**
* `/notes/:id` (Update notes by id)
* `/category/:id` (Update category by id)
**4. DELETE**
* `/notes/:id` (Delete notes by id)
* `/category/:id` (Delete category by id)
Author