Image for post
Image for post

📄 Table of contents

◉ all about nodeJS

◉ Why is nodeJS NOT considered a Framework ?

◉ What is NPM?

Modules in NodeJS?

var http = require(‘http’);
var express = require('express');
var fs = require('fs');

◉ Callbacks in nodeJS

Image for post
Image for post
Image for post
Image for post

◉ A Simple NodeJS server (without Express JS)

Creating Simplest server using “http” module
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var url = req.url;
if(url ==='/about'){
res.write('<h1>about us page<h1>');
res.end();
}
else if(url ==='/contact'){
res.write('<h1>contact us page<h1>');
res.end();
}
else{
res.write('<h1>Hello World!<h1>');
res.end();
}}).listen(3000, function(){
console.log("server start at port 3000");
//the server object listens on port 3000
});

nodemon

npm install nodemon -g
Image for post
Image for post
Image for post
Image for post

What is ExpressJS?

Image for post
Image for post

◉ Building a simple REST API with NodeJS and Express.

download the most stable release of NodeJS.
Open cmd => check for
npm -v
node -v
to confirm that above installation has been successful
npm install express — save
var express = require(“express”);
var app = express();
app.listen(3000, () => {
console.log(“Server is running on port 3000”);
});
Image for post
Image for post
node app.js
Image for post
Image for post

◉ how to server Static files in nodeJS.

Building a Node.js API using nodeJS + Express + MongoDB

What Is Better Node JS Or Angular JS?

NW.js (formerly node-webkit)

Experience with Front-end Technologies and MERN / MEAN Stack. Working on all Major UI Frameworks like React, Angular.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store