A restful Api built for serving as a Backend for a JS Promise App.
- Please Use POSTMAN in order to post data !
Live Application Back-End API
Description
- Built a rest Api in Node.js by leveraging Node.js + MongoDB.
- ORM Used Mongoose.
- A restful Api built for serving as a Backend for a JS Promise App.
How it works !
Api Consist of following End Points
router.get('/categories',callback.get_categories);
router.post('/categories',callback.post_categories);
router.get('/categories/:dish_ID',callback.get_categories_by_ID);
router.get('/menuItems',callback.get_menuItems);
router.post('/menuItems',callback.post_menuItems);
router.get('/',callback.basic_route);
Installation Instructions β
-
Clone or download the repo. into any fresh temporary folder.
-
Cd into that root folder you just cloned locally.
-
Open terminal in the current folder and to install all dependencies type
npm install
- Now typing
npm start
- will start a server !
DB Used (MongoDB)
- MLab's MongoDB hosting platform is the fastest growing cloud Database-as-a-Service in the world. Get started with a free database and expert support.
Package Manager Used (NPM)
- NPM is the default package manager for the JavaScript runtime environment Node.js.
Package.json (dependencies)
- For dependencies refer Package.json.
For Testing (Postman)
- Postman extension can be used for testing !
- Supercharge your API workflow with Postman! Build, test, and document your APIs faster.
- You can now fire up postman and then perform several operations on the REST API.
Contributing
-
Create your branch:
git checkout -b my-new-feature
-
Commit your changes:
git commit -m 'Add some feature'
-
Push to the branch:
git push origin my-new-feature
-
Send a Pull Request
-
Enjoy!
Examples
- GET Request to URL https://divyanshu-restaurant.herokuapp.com/api/categories
- GET Request to URL https://divyanshu-restaurant.herokuapp.com/api/menuItems
- GET Request to URL https://divyanshu-restaurant.herokuapp.com/api/menuItems?categories=A