REST API using Node.js and Express.js framework with MysqlCache for working with Mysql.
Currently, the API can be reached by everyone who has the db's credentials specified in "root_project/config/config.js".
Basics:
- Use an authentication with credentials.
- Generate a Token which has 2 hours and then it expires.
- Api's Authentication with token in http header (X-Access-Token)
- Specify rules, for each users
- Use secure http (https)
You need to have installed Node.js
To install dependencies enter project folder and run following command:
npm install
To run server execute:
npm start
Some of non standard modules used:
npm run build
curl -X GET localhost:3000/pets
curl -X GET localhost:3000/pets/:id
curl -X POST --data "name=MyNewPet&age=10" http://localhost:3000/pets
curl -X DELETE http://localhost:3000/pets/:id
For running ESLint
./node_modules/.bin/eslint */*.js *.js
For running test using Jasmine-node
npm test