mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
refactor: 🚚 Organize code into sub-packages, instead of a single large package
This commit is contained in:
parent
79742f47dc
commit
a6d3ebbeef
366 changed files with 942 additions and 833 deletions
13
packages/api/routes.ts
Normal file
13
packages/api/routes.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { FileSystemRouter } from "bun";
|
||||
// Returns the route filesystem path when given a URL
|
||||
export const routeMatcher = new FileSystemRouter({
|
||||
style: "nextjs",
|
||||
dir: "packages/api/routes",
|
||||
fileExtensions: [".ts", ".js"],
|
||||
});
|
||||
|
||||
export const routes = Object.fromEntries(
|
||||
Object.entries(routeMatcher.routes)
|
||||
.filter(([route]) => !route.endsWith(".test"))
|
||||
.map(([route, path]) => [route, path]),
|
||||
) as Record<string, string>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue