Simple NodeJS based RESTful service with async/await using ExpressJS and Sequelize.
Instructions to build and run:
- npm install
- npm run build
- node lib/server.js
- This will start HTTP server on port 3000.
- Create - POST:
- curl 'http://localhost:3000/' -H 'Content-Type: application/json' --data-binary $'{"name": "Qwer", "age": 30}'
- Retrieve - GET:
- curl 'http://localhost:3000/3' -H 'Accept: application/json'
- Udate - PUT:
- curl 'http://localhost:3000/' -X PUT -H 'Accept: application/json' -H 'Content-Type: application/json' --data-binary $'{"id": 5, "name": "Abc", "age": 60}'
- Delete - DELETE:
- curl 'http://localhost:3000/5' -X DELETE -H 'Accept: application/json' 'Content-Type: application/json'