Last active
October 16, 2019 11:43
-
-
Save abhi11210646/b36318fcacf6d09e16dda4c2befe51bd to your computer and use it in GitHub Desktop.
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
const http = require("http"); | |
const server = http.createServer((req,res)=>{ | |
console.log("request came", req.url); | |
// faking 1 sec amount of work | |
setTimeout(()=>{ | |
console.log("response sent", req.url); | |
res.writeHead(200, { 'Content-Type': 'text/plain' }); | |
res.end('okay'); | |
},1000); | |
}); | |
server.listen(3001,()=>{ | |
console.log("listening...") | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment