init server 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('Some HTML
');
res.send('Even more HTML
');
});
app.listen(PORT, () => console.log(`Server is listening on port ${PORT}`));
Example 2: setup node js express basic setup
npm init -y
npm i express