diff --git a/src/index.ts b/src/index.ts
index 7a401bb79..29daa1b57 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -328,6 +328,12 @@ async function startWebhook(
// Twilio sends application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: false }));
+ app.use((req, _res, next) => {
+ if (verbose) {
+ console.log(chalk.gray(`REQ ${req.method} ${req.url}`));
+ }
+ next();
+ });
app.post(path, async (req: Request, res: Response) => {
const { From, To, Body, MessageSid } = req.body ?? {};
@@ -365,6 +371,10 @@ async function startWebhook(
res.type('text/xml').send('');
});
+ app.use((req, res) => {
+ res.status(404).send('warelay webhook: not found');
+ });
+
return new Promise((resolve) => {
app.listen(port, () => {
console.log(`📥 Webhook listening on http://localhost:${port}${path}`);