From 386e65fa88098aa98af5be61665d16920e33dfae Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 2 Aug 2026 22:32:30 -0400 Subject: [PATCH] refactor: use model.getRoute in the catch-all instead of raw SQL The app.all("*") dispatcher hand-rolled a SELECT * FROM routes while every other read goes through the model layer. Use model.getRoute for consistency; the handler only reads structure_id/id/verb/handler, all of which it returns. Co-Authored-By: Claude Opus 4.8 --- index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/index.js b/index.js index 7410361..46e95bb 100644 --- a/index.js +++ b/index.js @@ -815,9 +815,7 @@ app.all("*", async (req, res) => { if (routeMatch) { req.params = routeMatch.params; - const route = db - .prepare("SELECT * FROM routes WHERE id = ?") - .get(routeMatch.id); + const route = model.getRoute(routeMatch.id); const structure = model.getStructure(route.structure_id);