server.js 4/4

PHOTO EMBED

Tue Sep 07 2021 19:41:09 GMT+0000 (UTC)

Saved by @devdave

// [4] CREATE Server
// app = function => receives req & res
const server = http.createServer(app);

server.on("error", errorHandler);
server.on("listening", () => {
  const address = server.address();
  const bind = typeof address === "string" ? "pipe " + address : "port " + port;
  console.log("Listening on " + bind);
});

// [=>] LISTEN Server on chosen port
server.listen(port);
content_copyCOPY