Saturday, April 7, 2018

NodeJS

Basic Setup :

1. NPM
2. Node
3. MongoDB

NVM (Node Version Manager) : used for keeping multiple versions of NodeJS


NPM : Node Package Manager: a javascript package manager.

MongoDB: Document database which stores data in JSON format.
mLabs is cloud service for free sandbox  of MongoDB upto 500MB

MongoDB GUI:
Compass can be used.


To check the version of node:
node -v
mongo -v
npm -v


To Start the server for MongoDB:
mongod

Express

Express is a lightweight web application framework for Node.js, which provides us with a robust set of features for writing web apps. These features include such things as route handling, template engine integration and a middleware framework, which allows us to perform additional tasks on request and response objects.
 There is nothing you can do in Express that you couldn’t do in plain Node.js, but using Express means we don’t have to re-invent the wheel and reduces boilerplate. 

Nodemon:

nodemon is a convenience tool. It will watch the les in the directory it was started in, and if it detects any changes, it will automatically restart your Node application (meaning you don’t have to). In contrast to Express, nodemon is not something the app requires to function properly (it just aids us with development), so install it using:
npm install --save-dev nodemon



Pug is a  templating engine. Pug (formerly known as Jade)  




No comments: