Express JS tutorial for beginners

From here we are going to start Express JS tutorial and this tutorial for absolute beginners.

What is Express JS

Express.js is an open source, Fast, flexible, minimalist web application framework for Node.js and it is designed for building Web Applications and APIs.

Why you use Express JS

I think by looking at the example given below, you will understand why you should use Express.js.

In the example, we just write a hello world script with express.js and without express.js.

Without express


const http = require('http');
const server = http.createServer((req, res) => {
    res.statusCode = 200;
    res.setHeader('Content-Type', 'text/html');
    res.write('<h3>Hello World</h3>');
server.listen(3000, () => console.log('server is running'));

With express

Easy, simple, beauty

const app = require('express')();
app.use('/',(req, res) => {
    res.send('<h3>Hello World</h3>');
app.listen(3000, () => console.log('server is running'));

Output of both

Browser Output

Hello World


You should know about Node JS, HTML and MVC Pattern

What you will learn in this Express js tutorial series

Next isInstall express and write your first app with the express

Leave a Reply

Your email address will not be published. Required fields are marked *