mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
why is this broken
This commit is contained in:
parent
e575075006
commit
86dd0eb7ef
2 changed files with 4 additions and 4 deletions
|
|
@ -99,10 +99,8 @@ export const routeMatcher = new Bun.FileSystemRouter({
|
||||||
dir: `${process.cwd()}/server/api`,
|
dir: `${process.cwd()}/server/api`,
|
||||||
});
|
});
|
||||||
|
|
||||||
export const matchRoute = async (url: string) => {
|
export const matchRoute = (url: string) => {
|
||||||
const route = routeMatcher.match(url);
|
const route = routeMatcher.match(url);
|
||||||
|
|
||||||
console.log(route);
|
|
||||||
|
|
||||||
return route ?? null;
|
return route ?? null;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -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
|
// 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"),
|
req.url.replace(".well-known", "well-known"),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(matchedRoute);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
matchedRoute &&
|
matchedRoute &&
|
||||||
Object.keys(matchedRoute).length !== 0 &&
|
Object.keys(matchedRoute).length !== 0 &&
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue