Created
February 9, 2018 11:59
-
-
Save odino/56be2f3cd76739a7e1a1ef97794f532a 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
let http = require('http') | |
let i = 0 | |
http.createServer((req, res) => { | |
let delay = 100 | |
if (i % 10 === 0) { | |
delay = 10000 | |
} | |
i++ | |
setTimeout(_ => { | |
res.writeHead(200) | |
res.write('Hello!') | |
res.end() | |
}, delay) | |
}).listen(3001) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment