Created
April 14, 2022 16:05
-
-
Save tgmarinho/f085f20c828a2fed772bf1fed4193d63 to your computer and use it in GitHub Desktop.
est-delayed-webhook hasura
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 = process.env.PORT || 3000; | |
function sleep(ms) { | |
return new Promise((resolve) => { | |
setTimeout(resolve, ms); | |
}); | |
} | |
app.all('/', async (req, res) => { | |
console.log(req) | |
console.log("Waiting"); | |
await sleep(10000); | |
console.log("Waiting done"); | |
res.status(200).send({status: "OK"}) | |
}) | |
app.listen(port, () => console.log(`Example app listening at http://localhost:${port}`)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment