node js starter template

Solutions on MaxInterview for node js starter template by the best coders in the world

showing results for - "node js starter template"
Jerri
27 Jun 2020
1const http = require("http");
2const port = 4040;
3
4const server = http.createServer((req, res) => {
5  if (req.url === "/") {
6    res.end("hello worrld");
7  } else {
8    res.end("404 not found");
9  }
10});
11server.listen(port, function () {
12  console.log(`http://localhost:${port}`);
13});
14