A simple RESTApi example with nodejs, tingodb(embedded db)
Dependency | Version | Install |
---|---|---|
NodeJS | 5.x.x | http://node.org |
npm | 3.x.x | http://node.org |
$ npm install
Used tingodb (embedded db) instead of mongodb.
$ npm install tingodb
Used Express Framework
- Allows to set up middlewares to respond to HTTP Requests.
- Defines a routing table which is used to perform different action based on HTTP Method and URL.
$ npm install express
- This is a node.js middleware for handling JSON, Raw, Text and URL encoded form data.
$ npm install body-parser
Used flow for Synchronization between collections joining purpose
$ npm install flow
- Download server.js, category.js, product.js files to a folder
- Go to that folder in command prompt
- Do the installations mentioned above
- Start using the api calls like [http://localhost:8085/api/listCategories] or [http://127.0.0.1:8085/api/listCategories] as the services are listening to port no [8085]
MIT