Answers for "node js starter template"

0

node js starter template

const http = require("http");
const port = 4040;

const server = http.createServer((req, res) => {
  if (req.url === "/") {
    res.end("hello worrld");
  } else {
    res.end("404 not found");
  }
});
server.listen(port, function () {
  console.log(`http://localhost:${port}`);
});
Posted by: Guest on September-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language