Express JS Introduction, Setup, First Program | Node JS Tutorial/Full Course in Hindi/Urdu #1
Welcome to the first lesson of our Node JS tutorial in Hindi/Urdu. In this lesson, we will cover an introduction to Express JS, how to set it up, and how to create your first program using Express JS.
What is Express JS?
Express is a web application framework for Node.js that is designed for building web applications and APIs. It provides a robust set of features for building web servers and handling requests and responses.
Setting up Express JS
To set up Express JS, you first need to have Node.js installed on your system. You can install Express JS using npm, the Node package manager. Simply run the following command in your terminal:
npm install express
This will install Express JS and its dependencies in your project directory.
Creating your First Program with Express JS
Now that you have Express JS set up, let’s create a simple web server using Express. Create a new file called app.js
and add the following code:
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send('Hello World!');
});
app.listen(3000, () => {
console.log('Server is running on port 3000');
});
Save the file and run it using Node.js by running the command node app.js
. You should see a message in the console indicating that the server is running on port 3000. Open your web browser and navigate to http://localhost:3000
to see the message “Hello World!” displayed on the page.
Congratulations! You have just created your first program using Express JS. Stay tuned for more lessons in our Node JS tutorial in Hindi/Urdu.
Great Tutorial
Awesome video ❤❤
Thanks for this informative video ❤️
Keep it up 🎉
Great work!!