Node - Js With Express Somasundaram S
Node - Js With Express Somasundaram S
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.
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.
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.
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
Pg:9
Pg:10