From 86dd0eb7efd4ab62ae04dc1ffeee29823ba59a76 Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Sun, 14 Apr 2024 01:57:26 -1000 Subject: [PATCH] why is this broken --- routes.ts | 4 +--- server.ts | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routes.ts b/routes.ts index ca3b5fcb..3fabb7ac 100644 --- a/routes.ts +++ b/routes.ts @@ -99,10 +99,8 @@ export const routeMatcher = new Bun.FileSystemRouter({ dir: `${process.cwd()}/server/api`, }); -export const matchRoute = async (url: string) => { +export const matchRoute = (url: string) => { const route = routeMatcher.match(url); - console.log(route); - return route ?? null; }; diff --git a/server.ts b/server.ts index 6874c73f..ee0ba983 100644 --- a/server.ts +++ b/server.ts @@ -116,10 +116,12 @@ export const createServer = ( } // If route is .well-known, remove dot because the filesystem router can't handle dots for some reason - const matchedRoute = await matchRoute( + const matchedRoute = matchRoute( req.url.replace(".well-known", "well-known"), ); + console.log(matchedRoute); + if ( matchedRoute && Object.keys(matchedRoute).length !== 0 &&