From 23dd7456c07c79b6f1cb547c8816030ef33dae74 Mon Sep 17 00:00:00 2001 From: Ru Chern Chong Date: Mon, 7 Oct 2024 23:46:30 +0800 Subject: [PATCH] Add Not Found handler --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 9c5e631..d5c64a7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,6 +46,8 @@ if (process.env.FEATURE_FLAG_RATE_LIMIT) { // return next(); // }); +app.notFound((c) => c.json({ message: `Not Found: ${c.req.path}` })); + app.get("/", async (c) => { const month = c.req.query("month"); return c.json(await getCarsByFuelType(FUEL_TYPE.PETROL, month));