Express REST API using Node.js and JSON as a database.
- Fully functional.
- Validation using express-validator.
- Check if the input is valid.
- Check if the user exists in the database.
- Secured using key authorization.
Method | Endpoint | Description |
---|---|---|
GET | /actresses | Get all the actresses. |
GET | /actresses/:id | Get actress by id. |
POST | /actresses | Add new actress. |
POST | /register | Register new user. |
POST | /user | Get user data. |
PUT | /actresses/:id | Update actress by id. |
DELETE | /actresses/:id | Delete actress by id. |
There is two ways to get authorized.
GET http://localhost:3000/endpoint?api_key=172uujqoyz1s33bnm6ow2te44s2i90
curl -H "x-api-key: 172uujqoyz1s33bnm6ow2te44s2i90" http://localhost:3000/endpoint
git clone https://github.com/thechampagne/express-rest-api.git
cd express-rest-api
npm install
npm start