Follow

Follow

Express JS : What is it ? & Prerequisite

If you're curious about Express JS, come learn it with me.

HARRISH G's photo
HARRISH G
·Oct 27, 2022·

3 min read

Express JS : What is it ? 
& Prerequisite

Table of contents

  • What is it?
  • Prerequisite

Halo guys, we are going to start series about Express js . This will be 1st article in that series.

First we look at

What is it?

Before that ,I will provide the explanation given by some famous website about Express js.

```Express.js, or simply Express, is a back end web application framework for building RESTful APIs with Node.js, released as free and open-source software under the MIT License. It is designed for building web applications and APIs. It has been called the de facto standard server framework for Node.js. ``` - **from Wikipedia** 

** Here comes , My way of explaining it .**

```Express.js is a web application framework for Node.js, designed for building web applications and APIs. It is a minimal and flexible framework that provides a set of features for web and mobile applications.it is minimalist framework built on Node.js helps in creating Powerful RESTful APIs. ``` -

Some of the features of Express.js include:

  • Routing: Express.js provides a simple and flexible way to create routes for your application.

  • Middleware: Express.js provides a large number of middleware functions that can be used to perform various tasks such as parsing request bodies, serving static files, and handling authentication.

  • Templating: Express.js can be used with a variety of templating engines, such as Pug and EJS, to easily create dynamic HTML pages.

  • Query string parsing: Express.js provides built-in support for parsing query strings, making it easy to access data passed in through URL parameters.

Prerequisite

To get familiar with Express js , we need some prerequisite.

  • Basic Knowledge of Javascript and Node.js

  • Curiosity in learning Express js.

  • Patience in reading this series.

First two prerequisite will be mandatory.

Further, you will need to have Node.js and npm (the package manager for Node.js) installed on your system. You can download and install Node.js from the official website (nodejs.org) or through a package manager, such as Homebrew (on macOS) or Chocolatey (on Windows). Once Node.js is installed, you can use npm to install Express and other packages.

Here is an example of how to install Express using npm:

$ npm install express

Once you have installed Express, you can use it to create a simple web server in Node.js. Here is an example of how to do this:

const express = require('express');
const app = express();

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

app.listen(3000, () => {
  console.log('Server listening on port 3000');
});

In this example, we have imported the Express module and created an instance of the Express application. We have then defined a route that listens for GET requests to the root path ("/") and sends a response with the message "Hello, World!". Finally, we have started the server on port 3000 and logged a message to the console to confirm that it is running.

In the Next blog , further details on how to start coding on Nodejs will be taught.

Get ready for it..

Thank you guys , please subscribe to my blog. so that you will get all my posts and blogs.

Did you find this article valuable?

Support HARRISH G by becoming a sponsor. Any amount is appreciated!

Learn more about Hashnode Sponsors
 
Share this