module express code example

Example 1: express js server

const express = require('express');
const app = express();
const PORT = process.env.PORT || 3000;

app.get('/', (req, res) => {
  res.send('<h1>Some HTML</h1>');
  res.send('<p>Even more HTML</p>');
});

app.listen(PORT, () => console.log(`Server is listening on port ${PORT}`));

Example 2: npm express

// npm install express
const express = require('express');
const app = express();

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

app.listen(3000,()=>{
 console.log("starting...");
});

Example 3: express js

Express.js, or simply Express, is a web application framework for 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.