Express start to “Express” !
Starting to learn Full Stack Development can be quite daunting at the beginning, especially, with the unlimited available resources and options now days. It was the same case with me. In the short period of time, I introduced myself to Node, Express, React, Angular, MongoDB and at the end it was like knowing nothing.
So today I will try to share some basic steps to understand the concepts of Express — a minimal and flexible node.js web application framework.
Note : You need to have Node and npm installed and have a basic understanding of Node.js i.e. how to run Node scripts and can install packages with npm, etc.
What is Express?
It’s a web framework that let’s you structure a web application to handle multiple different http requests at a specific url. Express is a minimal, open source and flexible Node.js web app framework designed to make developing websites, web apps, & API’s much easier.
Express basically helps you manage everything, from routes, to handling requests and views.
Let’s see how !!
Creating New Project and Installing Express?
Step 1.
- Move to Command Prompt (In Windows) and use command mkdir for creating a new folder as shown below , then move inside that folder.

Step 2.
- Now create a new package.json file by using command npm init and leaving all the default values as it is by pressing Enter key ( Screenshot shown below).
- Package.json holds various metadata relevant to the project i.e dependencies, project description, the version of the project, etc.

Step 3.
- Next step is to install Express for setting up an API. So use following command to install express npm install express — save ( for saving it as a dependency)
- To verify, it is successfully installed , move into any code editor and check the dependency in package.json file( I am using VS code, so in terminal just write code .)

Step 4.
- In the root folder of project, create a file with name index.js ( this would be the main file for configuring routes and starting the server)
- Now in the index.js file we will configure our routes by following steps
- Import express by using require statement and assigning it to a constant-> const express = require(“express”);
- Create a new express app -> var app = express();
- Create a variable to assign a value of port to which our application would be listening -> const port = process.env.PORT || 3000;
- Now we will create a route with get method. -> Get method takes in 2 arguments: (1) the url (2) the function that tells express what to send back to the person making the request. app.get(“/”, (req, res) => {res.send(“<h1>Hello Express</h1>”);});
- Now at last we bind the app to the port created above. -> app.listen(port, () => {console.log(`App listening on port 8888`);});
AND WE ARE ALL DONE !
Now to run the server , just go back to terminal and type node index.js or nodemon index.js ( if nodmon installed).

No go the browser and verify the server is correctly running or not by issuing the url -> localhost:3000 and we will see the below output and that’s fantastic.

With just 6 steps we have created our complete web application.