by Yogesh | Oct 17, 2018 | Node JS Tutorial
express router tutorial Basic setup command npm init npm install express var express = require('express'); var myrouter = express.Router(); myrouter.get('/', function(req, res){ res.send('Get Route without parameter'); }); myrouter.get('/about', function(req, res){...
by Yogesh | Oct 16, 2018 | Node JS Tutorial
What is express middleware Middleware functions are functions that have access to the request object (req), the response object (res), and the next function in the application’s request-response cycle. The next function is a function in the Express router which, when...
by Yogesh | Oct 2, 2018 | Node JS Tutorial
server html static files into node application Index Us Home About Us About Us Contact Us Contact Us h1 { color: red; } var http = require('http'); var fs = require('fs'); http.createServer(function(req,res){ var content = ''; var type = ''; if(req.url === "/") {...
by Yogesh | Oct 2, 2018 | Node JS Tutorial
Define and using Modules: node module export or import The module in the node is a simple JavaScript library where we write some variable and functions. in this tutorial, I am going to discuss that how we can define the module and import the module in another module....
by Yogesh | May 27, 2018 | Node JS Tutorial
Installation and verification of NODE Installation of NODE JS https://nodejs.org/en/download/ (Website URL to install Node JS) 2. Check NODE installation Write Following command in command prompt node -v( It will show version of the...
by Yogesh | Mar 30, 2018 | Node JS Tutorial
Most Used NPM Commands Using of NPM commands is very easy. NPM commands are managed in package.json and package.json is used to manage project’s dependencies. The following are the top NPM commands. npm init: Displays a simple wizard to help you create and describe...