I have written the below code
`use strict`;
const express = require(`express`);
//constansts
const PORT = 7777;
const HOST = `0.0.0.0`;
//App
const app = express();
app.get(`/`,(req,res) => {
res.send(`hello from nodejs`)
});
app.listen(PORT,HOST);
console.log(`Running on http://${HOST}:${PORT}`);
Outcome
This is my package.json
{
"name": "samplenodejsserver",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
}
UPDATE
It's working at HTTP ://127.0.0.1:7777 But not at HTTP ://0.0.0.0:7777