https://github.com/marioblazek/express-js-curl
This is a simple REST API written in Express.js framework. The main goal behind is to consume it via curl command line HTTP client.
https://github.com/marioblazek/express-js-curl
curl expressjs http javascript
Last synced: 3 months ago
JSON representation
This is a simple REST API written in Express.js framework. The main goal behind is to consume it via curl command line HTTP client.
- Host: GitHub
- URL: https://github.com/marioblazek/express-js-curl
- Owner: MarioBlazek
- License: mit
- Created: 2020-12-09T08:23:00.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-12-11T14:00:52.000Z (over 5 years ago)
- Last Synced: 2025-01-12T09:32:08.697Z (over 1 year ago)
- Topics: curl, expressjs, http, javascript
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Express JS API
This is a simple REST API written in Express.js framework. The main goal behind is to
consume it via `curl` command line http client.
## Setup
Follow these steps to set up the project:
* copy `db.config.template.js` file to `db.config.js`
* create MySQL database
* update `db.config.js` with your data
* execute `npm install`
* when ready, execute `npm start`
## Dependencies
Project depends on:
* [body-parser](https://www.npmjs.com/package/body-parser)
* [express](https://www.npmjs.com/package/express)
* [jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken)
* [mysql2](https://www.npmjs.com/package/mysql2)
* [sequelize](https://www.npmjs.com/package/sequelize)
## Routes
### Authorization
* POST `/auth` - requires email and password, returns token
* POST `/auth/refresh` - extends validity of token
### User management
* GET `/users` - displays a list of users
* POST `/users` - create new user
* GET `/users/:userId` - returns info about single user
* PATCH `/users/:userId` - updates user
* DELETE `/users/:userId` - removes user