Skip to content

Instantly share code, notes, and snippets.

@tgmarinho
Created April 14, 2022 16:05
Show Gist options
  • Save tgmarinho/f085f20c828a2fed772bf1fed4193d63 to your computer and use it in GitHub Desktop.
Save tgmarinho/f085f20c828a2fed772bf1fed4193d63 to your computer and use it in GitHub Desktop.
est-delayed-webhook hasura
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