mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 16:38:19 +01:00
More logging
This commit is contained in:
parent
da09d10e9a
commit
e575075006
|
|
@ -101,9 +101,8 @@ export const routeMatcher = new Bun.FileSystemRouter({
|
|||
|
||||
export const matchRoute = async (url: string) => {
|
||||
const route = routeMatcher.match(url);
|
||||
if (!route) return { file: null, matchedRoute: null };
|
||||
|
||||
return {
|
||||
matchedRoute: route,
|
||||
};
|
||||
console.log(route);
|
||||
|
||||
return route ?? null;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -116,11 +116,15 @@ 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 = await matchRoute(
|
||||
req.url.replace(".well-known", "well-known"),
|
||||
);
|
||||
|
||||
if (matchedRoute && matchedRoute.name !== "/[...404]") {
|
||||
if (
|
||||
matchedRoute &&
|
||||
Object.keys(matchedRoute).length !== 0 &&
|
||||
matchedRoute.name !== "/[...404]"
|
||||
) {
|
||||
return await processRoute(matchedRoute, req, logger);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue