Last active
January 8, 2021 00:07
-
-
Save azat-co/ee4038e32db3581b8b4fb34ef15ff00d 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 port = 80 | |
require('http') | |
.createServer((req, res) => { | |
console.log('url:', req.url) | |
console.log('now we will slow down and block and consume CPU...') | |
for (var i=0; i< 100000000; i++) {} | |
res.end('hello world') | |
}) | |
.listen(port, (error)=>{ | |
console.log(`server is running on ${port}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment