mirror of
https://github.com/bknd-io/bknd/
synced 2026-08-03 16:46:00 +00:00
added a few initial plugins
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { App, AppPlugin } from "bknd";
|
||||
import { showRoutes as showRoutesHono } from "hono/dev";
|
||||
|
||||
export type ShowRoutesOptions = {
|
||||
once?: boolean;
|
||||
};
|
||||
|
||||
export function showRoutes({ once = false }: ShowRoutesOptions = {}): AppPlugin {
|
||||
let shown = false;
|
||||
return (app: App) => ({
|
||||
name: "bknd-show-routes",
|
||||
onBuilt: () => {
|
||||
if (once && shown) return;
|
||||
shown = true;
|
||||
showRoutesHono(app.server);
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user