Express Overview

Express.js is a web framework for Node.js

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
const express = require('express');

const app = express();

app.use(...); // get and post or middle ware

app.get('/', (req, res) => {
    return res.send({hello:"world"});
})

const PORT = 4000;
app.listen(PORT, ()=> {
    console.log(`Server is ready on http://localhost:${PORT}`);
})