In this video we are going to learn about Express framework.
Express is an extensible web framework built for the Node.js ecosystem.
It enables you to create a web server that is more readable, flexible, and maintainable than you would be able to create using only the Node HTTP library, which can get complicated for even the most basic web servers.
Now lets create new express project.
So first of all go to the project location.
Here I am going to create project on my desktop.
So go to the desktop and here just create a new folder.
Let say folder name is expresspro.
Now just open this folder and here open command prompt.
For that in file explorere url just type cmd and press enter.
Now inside the command prompt run the command.


npm init


Now install the express module so run the command.

npm install --save express


Now open this project into the visual studio code.
Now inside the project lets create a new file index.js.
Just open this fileIn and inside the index.js file first of all require the express framework module.


const express = require('express');


Now sets up the Express application and create a route and just return a text.


const app=express();
app.get('/', (request, response) => {
response.send('hello world');
});
app.listen(3000, ()=> {
console.log('Express intro running on localhost:3000');
});



The app.listen() function tells the server to start listening for connections on a particular port, in this case port 3000.
Now lets run this.
So switch to the command prompt and run the command.


node index.js


Now its running on localhost:3000 port.
So let check.
Switch to the browser and goto the url localhost:3000.
You can see the message \"hello world\".
Now lets see the simple routes in express.
So goto the index.js file and create some routes.


app.get('/home', (request, response) => {
response.send(Home Page');
});
app.get('/about', (request, response) => {
response.send('About Page');
});
app.get('/contact', (request, response) => {
response.send('Contact Page');
});




Now lets run this.
So switch to the command prompt and run the command.

node index.js


Now it running.
So goto the browser and just refesh.
Now add to the url /home
You can see the home page.
Now go to the url /about, you can see the About Page.
Now go to the url /contact, you can see the Contact Page.
So in this way you can create a new express project.