JavaScript at Backend
Agenda
Agenda
1. What?
Agenda
1. What?
2. Installing
Agenda
1. What?
2. Installing
3. Hello World.
Agenda
1. What?
2. Installing
3. Hello World.
4. How to run NodeJS Application.
Agenda
1. What?
2. Installing
3. Hello World.
4. How to run NodeJS Application.
5. NodeJS Internal Modules
Agenda
1. What?
2. Installing
3. Hello World.
4. How to run NodeJS Application.
5. NodeJS Internal Modules
○ fs(file-system) (sync vs async)
Agenda
1. What?
2. Installing
3. Hello World.
4. How to run NodeJS Application.
5. NodeJS Internal Modules
○ fs(file-system) (sync vs async)
○ http/https (HTTP Server with NodeJS)
Agenda
1. What?
2. Installing
3. Hello World.
4. How to run NodeJS Application.
5. NodeJS Internal Modules
○ fs(file-system) (sync vs async)
○ http/https (HTTP Server with NodeJS)
6. Handling HTTP Request
About Me
Amit Thakkar
Tech Blogger @ CodeChutney.in
JavaScript Lover
Working on MEAN Stack
Twitter: @amit_thakkar01
LinkedIn: linkedin.com/in/amitthakkar01
Facebook: facebook.com/amit.thakkar01
What?
Installing
https://nodejs.org/download/
Hello World
You can checkout Demo form:
https://github.com/AmitThakkar/JavaScript-at-Backend-NodeJS
How to run NodeJS App?
You can checkout Demo form: https://github.com/AmitThakkar/JavaScript-at-
Backend-NodeJS
Node Internal Modules: fs
(function (require) {
var fs = require('fs');
fs.unlinkSync('test2');
console.log('successfully deleted test2');
})(require);
Node Internal Modules: fs
(function (require) {
var fs = require('fs');
fs.unlinkSync('test2');
console.log('successfully deleted test2');
})(require);
Node Internal Modules: fs
(function (require) {
var fs = require('fs');
fs.unlinkSync('test2');
console.log('successfully deleted test2');
})(require);
Node Internal Modules: fs
(function (require) {
var fs = require('fs');
fs.unlink('test', function (err) {
if (err) throw err;
console.log('successfully deleted test');
});
})(require);
Node Internal Modules: fs
(function (require) {
var fs = require('fs');
fs.unlink('test', function (err) {
if (err) throw err;
console.log('successfully deleted test');
});
})(require);
Node Internal Modules: fs
(function (require) {
var fs = require('fs');
fs.unlink('test', function (err) {
if (err) throw err;
console.log('successfully deleted test');
});
})(require);
You can checkout Demo form: https://github.com/AmitThakkar/JavaScript-at-
Backend-NodeJS
Node Internal Modules: http
var http = require("http");
var server = http.createServer(requestHandler);
server.listen(9999, function() {
console.log('Server running at http://localhost:9999/');
});
function requestHandler(request, response) {
console.log("Request received.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}
Node Internal Modules: http
var http = require("http");
var server = http.createServer(requestHandler);
server.listen(9999, function() {
console.log('Server running at http://localhost:9999/');
});
function requestHandler(request, response) {
console.log("Request received.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}
Node Internal Modules: http
var http = require("http");
var server = http.createServer(requestHandler);
server.listen(9999, function() {
console.log('Server running at http://localhost:9999/');
});
function requestHandler(request, response) {
console.log("Request received.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}
Node Internal Modules: http
var http = require("http");
var server = http.createServer(requestHandler);
server.listen(9999, function() {
console.log('Server running at http://localhost:9999/');
});
function requestHandler(request, response) {
console.log("Request received.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}
Node Internal Modules: http
var http = require("http");
var server = http.createServer(requestHandler);
server.listen(9999, function() {
console.log('Server running at http://localhost:9999/');
});
function requestHandler(request, response) {
console.log("Request received.");
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}
You can checkout Demo form: https://github.com/AmitThakkar/JavaScript-at-
Backend-NodeJS
Handling HTTP Request
var requestHandler = function (request, response) {
var data = "";
switch (request.url) {
case "/" :
data = "HelloWorld";
break;
case "/me" :
data = "This is Me!";
break;
default :
data = "You lose in space";
}
response.writeHead(200, {"Content-Type": "text/plain"});
response.write(data);
response.end();
};
Handling HTTP Request
var requestHandler = function (request, response) {
var data = "";
switch (request.url) {
case "/" :
data = "HelloWorld";
break;
case "/me" :
data = "This is Me!";
break;
default :
data = "You lose in space";
}
response.writeHead(200, {"Content-Type": "text/plain"});
response.write(data);
response.end();
};
Questions??
References:
Create Basic HTTP Server with Node.js

More Related Content

PDF
Non-blocking I/O, Event loops and node.js
PPT
RESTful API In Node Js using Express
KEY
OSCON 2011 - Node.js Tutorial
PDF
Server Side Event Driven Programming
KEY
Writing robust Node.js applications
PPTX
Introduction to Node js
PDF
Node.js and How JavaScript is Changing Server Programming
PPTX
Introduction Node.js
Non-blocking I/O, Event loops and node.js
RESTful API In Node Js using Express
OSCON 2011 - Node.js Tutorial
Server Side Event Driven Programming
Writing robust Node.js applications
Introduction to Node js
Node.js and How JavaScript is Changing Server Programming
Introduction Node.js

What's hot (20)

PPTX
Introduction to node.js GDD
PPTX
Introduction to Node.js
PDF
All aboard the NodeJS Express
PPT
Nodejs Event Driven Concurrency for Web Applications
PDF
PPTX
Node js introduction
PPTX
introduction to node.js
KEY
node.js: Javascript's in your backend
PDF
Nodejs presentation
PPTX
Node.js Patterns for Discerning Developers
PDF
NodeJS for Beginner
PDF
Node.js
PDF
Node.js Explained
PPTX
Intro to Node.js (v1)
PDF
Use Node.js to create a REST API
PDF
Original slides from Ryan Dahl's NodeJs intro talk
PDF
Introduction to Node.js: What, why and how?
PPTX
NodeJS - Server Side JS
PDF
KEY
Introduction to node.js
Introduction to node.js GDD
Introduction to Node.js
All aboard the NodeJS Express
Nodejs Event Driven Concurrency for Web Applications
Node js introduction
introduction to node.js
node.js: Javascript's in your backend
Nodejs presentation
Node.js Patterns for Discerning Developers
NodeJS for Beginner
Node.js
Node.js Explained
Intro to Node.js (v1)
Use Node.js to create a REST API
Original slides from Ryan Dahl's NodeJs intro talk
Introduction to Node.js: What, why and how?
NodeJS - Server Side JS
Introduction to node.js
Ad

Viewers also liked (20)

PDF
Complete MVC on NodeJS
PPTX
Create Rest API in Nodejs
PDF
Workshop 4: NodeJS. Express Framework & MongoDB.
PDF
hbase lab
PPTX
Les règles de passage
PPTX
PPTX
Eucalyptus
PDF
#7 "Многообещающий JavaScript – Promises" Денис Речкунов
PPTX
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
PDF
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
KEY
NodeJS
PDF
Node.js in action
ODP
Neurobollocks: el nuevo aceite de serpiente
PDF
Node.js & Twitter Bootstrap Crash Course
PPT
How to scale and deploy NodeJS app
PPTX
Nodejs introduce - using Socket.io
PDF
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
PDF
Burgas Conf 21.06.2014 - Single page application Angularjs and Nodejs
PPTX
High Performance NodeJS
ODP
Asynchronous I/O in NodeJS - new standard or challenges?
Complete MVC on NodeJS
Create Rest API in Nodejs
Workshop 4: NodeJS. Express Framework & MongoDB.
hbase lab
Les règles de passage
Eucalyptus
#7 "Многообещающий JavaScript – Promises" Денис Речкунов
Why Node, Express and Postgres - presented 23 Feb 15, Talkjs, Microsoft Audit...
JavaScript as a Server side language (NodeJS): JSConf 2011, Dhaka
NodeJS
Node.js in action
Neurobollocks: el nuevo aceite de serpiente
Node.js & Twitter Bootstrap Crash Course
How to scale and deploy NodeJS app
Nodejs introduce - using Socket.io
Nimrod: MongoDB Shell in NodeJS (JSConfUY 2015)
Burgas Conf 21.06.2014 - Single page application Angularjs and Nodejs
High Performance NodeJS
Asynchronous I/O in NodeJS - new standard or challenges?
Ad

Similar to Java script at backend nodejs (20)

PPTX
Introduction to node js
PPT
nodejs_at_a_glance.ppt
PPT
nodejs_at_a_glance, understanding java script
PPTX
Introduction to Node (15th May 2017)
DOCX
Node js getting started
PPTX
Requiring your own files.pptx
PPTX
Node.js System: The Approach
PPT
Node js beginner
PDF
Introduction to Node JS1.pdf
PDF
Node.js - async for the rest of us.
PPTX
Scalable network applications, event-driven - Node JS
PDF
Node intro
PPT
Node.js
KEY
Node.js - A practical introduction (v2)
PPTX
Introducing Node.js in an Oracle technology environment (including hands-on)
PPTX
Node.js web-based Example :Run a local server in order to start using node.js...
KEY
Introduction to NodeJS with LOLCats
PPTX
A slightly advanced introduction to node.js
PPTX
Node.js Workshop - Sela SDP 2015
PDF
Node.js introduction
Introduction to node js
nodejs_at_a_glance.ppt
nodejs_at_a_glance, understanding java script
Introduction to Node (15th May 2017)
Node js getting started
Requiring your own files.pptx
Node.js System: The Approach
Node js beginner
Introduction to Node JS1.pdf
Node.js - async for the rest of us.
Scalable network applications, event-driven - Node JS
Node intro
Node.js
Node.js - A practical introduction (v2)
Introducing Node.js in an Oracle technology environment (including hands-on)
Node.js web-based Example :Run a local server in order to start using node.js...
Introduction to NodeJS with LOLCats
A slightly advanced introduction to node.js
Node.js Workshop - Sela SDP 2015
Node.js introduction

More from Amit Thakkar (9)

PDF
Packer
PDF
Packer
PPTX
AWS Cloud Formation
PPTX
A different thought angular js part-3
PPTX
A different thought angular js part-2
PPTX
A different thought AngularJS
PPTX
Building user interface with react
PPTX
Get expertise with mongo db
PPTX
Design pattern in an expressive language java script
Packer
Packer
AWS Cloud Formation
A different thought angular js part-3
A different thought angular js part-2
A different thought AngularJS
Building user interface with react
Get expertise with mongo db
Design pattern in an expressive language java script

Recently uploaded (20)

PDF
Credit Without Borders: AI and Financial Inclusion in Bangladesh
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PPTX
Benefits of Physical activity for teenagers.pptx
DOCX
search engine optimization ppt fir known well about this
PPTX
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PDF
Getting started with AI Agents and Multi-Agent Systems
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PPT
Geologic Time for studying geology for geologist
PDF
Consumable AI The What, Why & How for Small Teams.pdf
PDF
Abstractive summarization using multilingual text-to-text transfer transforme...
PDF
1 - Historical Antecedents, Social Consideration.pdf
PDF
Architecture types and enterprise applications.pdf
PPTX
The various Industrial Revolutions .pptx
PPTX
Configure Apache Mutual Authentication
PDF
A review of recent deep learning applications in wood surface defect identifi...
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
sbt 2.0: go big (Scala Days 2025 edition)
Credit Without Borders: AI and Financial Inclusion in Bangladesh
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
Benefits of Physical activity for teenagers.pptx
search engine optimization ppt fir known well about this
AI IN MARKETING- PRESENTED BY ANWAR KABIR 1st June 2025.pptx
A proposed approach for plagiarism detection in Myanmar Unicode text
NewMind AI Weekly Chronicles – August ’25 Week III
Getting started with AI Agents and Multi-Agent Systems
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Geologic Time for studying geology for geologist
Consumable AI The What, Why & How for Small Teams.pdf
Abstractive summarization using multilingual text-to-text transfer transforme...
1 - Historical Antecedents, Social Consideration.pdf
Architecture types and enterprise applications.pdf
The various Industrial Revolutions .pptx
Configure Apache Mutual Authentication
A review of recent deep learning applications in wood surface defect identifi...
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
Final SEM Unit 1 for mit wpu at pune .pptx
sbt 2.0: go big (Scala Days 2025 edition)

Java script at backend nodejs

  • 6. Agenda 1. What? 2. Installing 3. Hello World. 4. How to run NodeJS Application.
  • 7. Agenda 1. What? 2. Installing 3. Hello World. 4. How to run NodeJS Application. 5. NodeJS Internal Modules
  • 8. Agenda 1. What? 2. Installing 3. Hello World. 4. How to run NodeJS Application. 5. NodeJS Internal Modules ○ fs(file-system) (sync vs async)
  • 9. Agenda 1. What? 2. Installing 3. Hello World. 4. How to run NodeJS Application. 5. NodeJS Internal Modules ○ fs(file-system) (sync vs async) ○ http/https (HTTP Server with NodeJS)
  • 10. Agenda 1. What? 2. Installing 3. Hello World. 4. How to run NodeJS Application. 5. NodeJS Internal Modules ○ fs(file-system) (sync vs async) ○ http/https (HTTP Server with NodeJS) 6. Handling HTTP Request
  • 11. About Me Amit Thakkar Tech Blogger @ CodeChutney.in JavaScript Lover Working on MEAN Stack Twitter: @amit_thakkar01 LinkedIn: linkedin.com/in/amitthakkar01 Facebook: facebook.com/amit.thakkar01
  • 12. What?
  • 15. You can checkout Demo form: https://github.com/AmitThakkar/JavaScript-at-Backend-NodeJS
  • 16. How to run NodeJS App?
  • 17. You can checkout Demo form: https://github.com/AmitThakkar/JavaScript-at- Backend-NodeJS
  • 18. Node Internal Modules: fs (function (require) { var fs = require('fs'); fs.unlinkSync('test2'); console.log('successfully deleted test2'); })(require);
  • 19. Node Internal Modules: fs (function (require) { var fs = require('fs'); fs.unlinkSync('test2'); console.log('successfully deleted test2'); })(require);
  • 20. Node Internal Modules: fs (function (require) { var fs = require('fs'); fs.unlinkSync('test2'); console.log('successfully deleted test2'); })(require);
  • 21. Node Internal Modules: fs (function (require) { var fs = require('fs'); fs.unlink('test', function (err) { if (err) throw err; console.log('successfully deleted test'); }); })(require);
  • 22. Node Internal Modules: fs (function (require) { var fs = require('fs'); fs.unlink('test', function (err) { if (err) throw err; console.log('successfully deleted test'); }); })(require);
  • 23. Node Internal Modules: fs (function (require) { var fs = require('fs'); fs.unlink('test', function (err) { if (err) throw err; console.log('successfully deleted test'); }); })(require);
  • 24. You can checkout Demo form: https://github.com/AmitThakkar/JavaScript-at- Backend-NodeJS
  • 25. Node Internal Modules: http var http = require("http"); var server = http.createServer(requestHandler); server.listen(9999, function() { console.log('Server running at http://localhost:9999/'); }); function requestHandler(request, response) { console.log("Request received."); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end(); }
  • 26. Node Internal Modules: http var http = require("http"); var server = http.createServer(requestHandler); server.listen(9999, function() { console.log('Server running at http://localhost:9999/'); }); function requestHandler(request, response) { console.log("Request received."); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end(); }
  • 27. Node Internal Modules: http var http = require("http"); var server = http.createServer(requestHandler); server.listen(9999, function() { console.log('Server running at http://localhost:9999/'); }); function requestHandler(request, response) { console.log("Request received."); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end(); }
  • 28. Node Internal Modules: http var http = require("http"); var server = http.createServer(requestHandler); server.listen(9999, function() { console.log('Server running at http://localhost:9999/'); }); function requestHandler(request, response) { console.log("Request received."); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end(); }
  • 29. Node Internal Modules: http var http = require("http"); var server = http.createServer(requestHandler); server.listen(9999, function() { console.log('Server running at http://localhost:9999/'); }); function requestHandler(request, response) { console.log("Request received."); response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end(); }
  • 30. You can checkout Demo form: https://github.com/AmitThakkar/JavaScript-at- Backend-NodeJS
  • 31. Handling HTTP Request var requestHandler = function (request, response) { var data = ""; switch (request.url) { case "/" : data = "HelloWorld"; break; case "/me" : data = "This is Me!"; break; default : data = "You lose in space"; } response.writeHead(200, {"Content-Type": "text/plain"}); response.write(data); response.end(); };
  • 32. Handling HTTP Request var requestHandler = function (request, response) { var data = ""; switch (request.url) { case "/" : data = "HelloWorld"; break; case "/me" : data = "This is Me!"; break; default : data = "You lose in space"; } response.writeHead(200, {"Content-Type": "text/plain"}); response.write(data); response.end(); };
  • 34. References: Create Basic HTTP Server with Node.js