Skip to content

Instantly share code, notes, and snippets.

@azat-co
Last active January 8, 2021 00:07
Show Gist options
  • Save azat-co/ee4038e32db3581b8b4fb34ef15ff00d to your computer and use it in GitHub Desktop.
Save azat-co/ee4038e32db3581b8b4fb34ef15ff00d to your computer and use it in GitHub Desktop.
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