mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28: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) => {
|
export const matchRoute = async (url: string) => {
|
||||||
const route = routeMatcher.match(url);
|
const route = routeMatcher.match(url);
|
||||||
if (!route) return { file: null, matchedRoute: null };
|
|
||||||
|
|
||||||
return {
|
console.log(route);
|
||||||
matchedRoute: 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
|
// 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"),
|
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);
|
return await processRoute(matchedRoute, req, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue