Introduction to Express- | Shalini Chauhan

Post

editor-img
Shalini Chauhan
Dec 21, 2022

Introduction to Express-

Express is a Web Framework built upon Node.js.

Node.js is an amazing tool for building networking services and applications. Express builds on top of its features to provide easy to use functionality that satisfies the needs of the Web Server use-case. It's Open Source, free, easy to extend and very performant.

There are also lots and lots of pre-built packages you can just drop in and use to do all kinds of things.

Installation

You can install Express into any project with npm.

If you're in an empty folder, first create a new Node.js project with

npm init -y

then run

npm install express

to install Express into the project.

The first example we're going to create is a simple Express Web Server.

const express = require('express')

const app = express()

app.get('/', (req, res) => res.send('Hello World!'))

app.listen(3000, () => console.log('Server ready'))

and start the server using

node index.js

You can open the browser to port 3000 on localhost and you should see the Hello World! message.

Keep on eyes for the next post of express:)


Tagged users
editor-img
Amit
@quarsh-panaka-ettie
i am a graduate student and currently working with jajal medical services as software engineer.
editor-img
Ravi
@orange-few
editor-img
Sailesh Verma
@chocolate-89
Developer @Gluelabs