What is Express js?

What is Express js?

Express.js is a web framework for Node.js. It is fast, robust and asynchronous in nature. It is a backend framework that is helpful for creating and managing servers and routes of your application.

Some of the features of Express.js:

  • it is useful for creating single-page, and multi-page applications.

  • It supports middlewares to respond to HTTP requests(GET,POST,PUT,PATCH,DELETE)

  • It defines a routing table that is used to perform different actions based on the HTTP method and URL.

  • It allows to dynamically render HTML Pages based on passing arguments to templates.

Create your Express server 👇:

//you need to install express package from npm. To install express package use following command
//npm i express
const express = require('express')
const app = express()

app.get('/', function(req, res){
   res.send("Hello from Express js! ");
});

app.listen(PORT, () => {
      console.log(`Server running on PORT no ${PORT}`)
    })