cairo/lib/vix/AppRouter.ts

16 lines
639 B
TypeScript
Raw Normal View History

2024-08-24 12:41:04 -06:00
import "express-async-errors";
import config from "@lib/config";
import { VixpressRouter } from "@dunemask/vix";
import { AuthRoute } from "@lib/modules/auth/auth.router";
import { ProjectRoute } from "@lib/modules/projects/project.router";
export default class AppRouter extends VixpressRouter {
protected routerImportUrl = import.meta.url; // Used to configure the relative static route
protected baseUrl = config.Server.basePath; // Path for static assets
async configureRoutes() {
// API Routes go here:
await this.useRoute("/api/:project/auth", AuthRoute);
await this.useRoute("/api/:project", ProjectRoute);
}
}