elysia-dynamic-route
v1.0.1
Published
Streaming event for any api methods.
Downloads
2
Readme
Elysia-Dynamic-Route
Getting started
bun a elysia-dynamic-route
npm i elysia-dynamic-route
yarn add elysia-dynamic-route
pnpm add elysia-dynamic-route
Usage
import { DynamicRoute, methodSchema } from "./DynamicRoute"
new Elysia()
.use(
DynamicRoute(undefined, {
name: "a_route",
group_path: "/a",
swaggerParams: {},
})
)
.post("/", ({ a_route }) => {
const conf = {
method,
path: `/${path}`,
handler: ({ body: {} }) => ({ xxx: `/${path}` }),
hook: {
body: t.Object({
path: t.String(),
method: methodSchema,
}),
},
}
return a_route(conf)
})