Easy Way to Make Server Using Express.JS

Easy Way to Make Server Using Express.JS

Nov 26, 2023

Prerequisites:

Install

  1. VS Code.

  2. NodeJs.

Here are a few steps to follow:

  1. Create a new folder and open it in VS Code.

  2. Open the terminal and navigate to the folder you created recently.

  3. Run these commands:

npm init -y
npm i express

4. Create a file named as Server.js .

5. Inside Server.js write the below code:

image

image

Express js Server Code

6. Run server.js using the terminal:

node server.js

Result:

Server started at Port 3000
Vous aimez cette publication ?

Achetez un café à Vishakha Sharma

Plus de Vishakha Sharma