Created
June 14, 2020 21:47
-
-
Save standinga/16c45f0b4ba132637fd64f2e30df1a3c to your computer and use it in GitHub Desktop.
This file contains hidden or 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 express = require('express') | |
const app = express() | |
const port = 3000 | |
const recursive = function (req, res) { | |
counter ++ | |
setTimeout(recursive, 300); | |
} | |
recursive() | |
var counter = 0 | |
app.get('/', (req, res) => { | |
console.log(`Counter: ${counter}`) | |
res.set('Cache-Control', 'public, max-age=110') | |
res.send(`Response: ${counter}`) | |
}) | |
app.listen(port, ()=> console.log(`listening at http://0.0.0.0:${port}`)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment