0
Q:

how to create an http server

const http = require("http");
const port = 3000; // Replace this if you want, this is just used for most examples

http.createServer("/", (req, res) => {
  res.writeHead(200);
  res.write("Hello World");
  res.end();
});

http.listen(port, console.log(`Server started at http://localhost:${port}`));
-1

New to Communities?

Join the community