Last active
April 27, 2020 15:27
-
-
Save kidbrax/e9c77c143bca23d769ab to your computer and use it in GitHub Desktop.
demo http server #coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http = require("http") | |
PORT = process.env.PORT or 3000 | |
http.createServer((req, res) -> | |
console.log "%d request received", process.pid | |
res.writeHead 200, | |
"Content-Type": "text/plain" | |
res.end "Hello world!\n" | |
return | |
).listen PORT | |
console.log "%d listening on %d", process.pid, PORT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment