Program: app.js: var express = require('express'); var app = express(); app.set('view engine', 'ejs'); a...
Read More
17 Program to demonstrate Template Engine using Embedded-JS and ExpressJS
Program: app.js: var express = require('express'); var app = express(); app.set('view engine', 'ejs'); a...
Read More
16 Program to handle Dynamic Route Params in ExpressJS
Program: var express = require('express'); const { response } = require('express'); const { request } = require('ht...
Read More
15 Intro to ExpressJS
Program: var express = require('express'); var app = express(); app.get('/home',function(request,response){ re...
Read More
14 Program to Manual Routing in NodeJS
Program: var http = require('http'); var fs = require('fs'); var server = http.createServer(function (request, respon...
Read More
13 Program for Sending JSON Data in NodeJS
Program: var http = require('http'); var fs = require('fs'); var server = http.createServer(function(request,response...
Read More
12 Program to Serving HTML Pages in NodeJS
Program: index.html: <!DOCTYPE html> <html> <body> <h1> Coding Atharva </h1> </bod...
Read More
11 Program to demonstrate Writable Stream in NodeJS
Program: var http = require('http'); var fs = require('fs'); var readStream = fs.createReadStream(__dirname+'/dem...
Read More
10 Program to demonstrate Readable Stream in NodeJS
Program: var http = require('http'); var fs = require('fs'); var readStream = fs.createReadStream(__dirname+'/dem...
Read More
9 Program to Create Own Server in NodeJS
Program: var http = require('http'); var server = http.createServer( function(request,response){ response.writeHead(200,{...
Read More
8 Program to Create and Delete Directory in NodeJS
Program: var fs = require('fs'); fs.mkdirSync('demo'); console.log('Demo Directory Create'); fs.rmdirSyn...
Read More
7 Program to Delete/Un-link File in NodeJS
Program: var fs = require('fs'); fs.unlink('demo.txt',function(){ console.log("File Deleted"); }); ...
Read More
6 Program to read and write file in NodeJS
Synchronous: First it will read the file then execute the next statement. Program: var fs = require('fs'); var r = fs.readF...
Read More
Subscribe to:
Posts (Atom)