0% found this document useful (0 votes)
120 views10 pages

Node - Js With Express Somasundaram S

The document discusses Node.js and Express. Node.js is a server-side JavaScript environment that uses an asynchronous event-driven model to provide excellent performance for internet applications. Express is a flexible Node.js web application framework that provides features for web and mobile applications. The document then provides instructions on installing Express and creating an Express server to respond to GET requests and listen on port 3000.

Uploaded by

Soma Sundaram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
120 views10 pages

Node - Js With Express Somasundaram S

The document discusses Node.js and Express. Node.js is a server-side JavaScript environment that uses an asynchronous event-driven model to provide excellent performance for internet applications. Express is a flexible Node.js web application framework that provides features for web and mobile applications. The document then provides instructions on installing Express and creating an Express server to respond to GET requests and listen on port 3000.

Uploaded by

Soma Sundaram
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Node.

js
Express

Presentation By

Somasundaram S
CSB19095
25/05/2021 Pg:1
Node.js is a server side JavaScript environment that uses an
asynchronous event driven model. This allows Node.js to
get excellent performance based on the architectures of
many Internet applications.

Node.js uses an event-driven, non-blocking I/O model that


makes it lightweight and efficient. Node.js’ package
ecosystem, npm, is the largest ecosystem of open source libraries
in the world.
Pg:2
Express is a minimal and flexible Node.js web application
framework that provides a robust set of features for web and
mobile applications.

Express.js is used for creating server side of web


application.

Pg:3
How to install?
Firstly, install the Express framework globally using NPM
so that it can be used to create a web application using
node terminal.

$ npm install express


You should install the following important modules along
with express −

$ npm install body-parser


$ npm install cookie-parser
$ npm install multer
Pg:4
NPM - Node Package Manager

Node Package Manager (NPM) is a command line tool that installs,


updates or uninstalls Node.js packages in your application. The node
community around the world creates useful modules and publishes
them as packages in this repository.

NPM is included with Node.js installation.

Pg:5
Creating an Express Server

Now that Express is installed, create a new server.js file and open it
with your code editor.

The first line here is grabbing the main Express module from the
package you installed.

Pg:6
These lines of code is where we tell our Express server how to
handle a GET request to our server.

Here, we are calling a function on res to send back a


response: ’Successful response.’

Pg:7
Finally, once we’ve set up our requests, we must start our server! We
are passing 3000 into the listen function, which tells the app which port
to listen on.

Pg:8
Revisit your terminal window and run your application:

$ node server.js

Then, visit localhost : 3000 in your web browser, Your browser


window will display: “Successful response”.

Your terminal window will display:


“Example app is listening on port 3000”,

Pg:9
Pg:10

You might also like