chore(server): simplify plugin route creation (#1594)

This commit is contained in:
Reed von Redwitz
2023-08-05 21:58:15 +02:00
committed by GitHub
parent 6d5428eeaa
commit cc0e2cb2ec
4 changed files with 23 additions and 2 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { MiddlewareHandlerContext, Plugin } from "$fresh/server.ts";
import { handler as testMiddleware } from "./sample_routes/_middleware.ts";
import { AppBuilder } from "./sample_routes/AppBuilder.tsx";
import { SimpleRoute } from "./sample_routes/simple-route.tsx";
export type { Options };
interface Options {
@@ -45,6 +46,6 @@ export default function routePlugin(
routes: [{
path: "/_app",
component: AppBuilder(options),
}],
}, { path: "no-leading-slash-here", component: SimpleRoute }],
};
}