Basic requirements to create and run a Node JS app

To create a Node.js app that acts as a back end for an Angular JS app, these are the minimum required modules.

  1. EXPRESS
    Express.js is basically helps you manage everything,from routes, to handling requests and views.
    Installation
    npm install express
    Usage
    var express=require(‘express’);
    var app=express();
    Reference link : https://www.npmjs.com/package/express
  2. BODY PARSER
    Body parser parse the incoming request bodies and it is available under the req.body property
    Installation
    npm install body-parser
    Usage
    var bodyParser = require(‘body-parser’)
    app.use(bodyParser.urlencoded({
    extended: true
    }));
    Reference link : https://www.npmjs.com/package/body-parser
  3. CORS
    cors exists for security reasons and to limit which resources a browser can gain access to, from another website.
    Installation
    npm install cors
    Usage
    var cors = require(‘cors’)
    app.use(cors());
    Reference link : https://www.npmjs.com/package/cors
  4. CRYPTO-JS
    Nodejs support for cryptography (eg:AES,CTR..)
    Installation
    npm install crypto-js
    Usage
    var crypto = require(‘crypto’);
    Reference link : https://www.npmjs.com/package/crypto-js

Leave a Comment