Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sandhupal/restful-web-apis-with-node.js-and-express

Building RESTful Web APIs with Node.js and Express
https://github.com/sandhupal/restful-web-apis-with-node.js-and-express

expressjs mongoose nodejs nodemon restful-api

Last synced: 20 days ago
JSON representation

Building RESTful Web APIs with Node.js and Express

Awesome Lists containing this project

README

        

# RESTful-Web-APIs-with-Node.js-and-Express

Building RESTful Web APIs with Node.js and Express

npm init = command to create a package.json

npm i --save express = Expressjs is a minimal and flexible Node.js web application framework

[install the mongoDB]

npm i --save mongoose = mongodb object modeling for node.js (writing MongoDB validation, casting and business logic boilerplate is a drag. That's why we wrote Mongoose). Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

npm i -save nodemon = nodemon reload, automatically. Automatic restarting of application. Detects default file extension to monitor.

npm i -save-dev babel-cli babel-preset-es2015 babel-preset-stage-0 = Babel convert ECMAScript code into a backwards compatible version of JavaScript in current and older browsers or environments.

npm i -save body-parser = extract the entire body portion of an incoming request stream and exposes it on req.body. This body-parser module parses the JSON, buffer, string and URL encoded data submitted using HTTP POST request.

Robomongo (Studio 3T for mongodb) = Like postman for mongodb

//Mongoose connection

mongoose.Promise = global.Promise;

mongoose.connect("mongodb://localhost/CRMdb", {

useMongoClient: true

});

//Body parser setup

app.use(

bodyParser.urlencoded({

extended: true

})

);

app.use(bodyParser.json());