NRAPI (Node.js RESTful API) is a simple Node.js RESTful API solution created using the Node-Restful library with Mongo DB integrations.
See the Node-Restful Documentation for more information about the built-in filters associated with the API.
npm install
- Prerequisite: Install Mongo DB
- Configure the server to connect to your Mongo DB database.
- Start the ExpressJS server by running the following commands:
npm start
The Node-Restful Documentation contains various details with respect to the features and functionality of the library.
- Create a new model using a Mongoose Schema and save it in
api/v1/models. - Modify
api/v1/routes/routes.jsto specify the desired HTTP requests associated with your model.
var customModel = require('../models/customModel');
customModel.methods(['get', 'put', 'post', 'delete']);
customModel.register(router, '/customModel');