Skip to content

Commit 805d5a2

Browse files
committed
chore: add webhooks example flush
1 parent 344b9d6 commit 805d5a2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

examples/webhooks/index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const express = require("express");
33
const FIFTEEN_MINUTES_IN_MS = 15 * 60 * 1000;
44
const app = express();
55

6-
const events = [];
6+
let events = [];
77

88
const port = process.env.PORT ?? "8080";
99
const companyIdentifier =
@@ -152,4 +152,9 @@ app.post("/webhooks", (req, res) => {
152152
}
153153
});
154154

155+
app.get("/flush", (req, res) => {
156+
events = [];
157+
return res.redirect('/');
158+
});
159+
155160
app.listen(port, () => console.log(`Listening on port ${port}`));

0 commit comments

Comments
 (0)