(ctx: Context, name: string, path: string)
| 270 | } |
| 271 | |
| 272 | export async function applyApiHandler(ctx: Context, name: string, path: string) { |
| 273 | ctx.plugin(ApiService); |
| 274 | await ctx.inject(['server', 'api'], ({ Route, Connection }) => { |
| 275 | Route(name, path, ApiHandler); |
| 276 | Connection(`${name}_conn`, `${path}/conn`, ApiConnectionHandler); |
| 277 | }); |
| 278 | } |
| 279 | |
| 280 | const TestApis = { |
| 281 | 'test.query': Query(Schema.object({ |