abearixong 90ecb8eb93 refactor: enhance RouteOpts and Route class generics for improved type safety
- Updated RouteOpts to accept an additional generic parameter for metadata type.
- Modified Route class to utilize the new generic parameter for metadata.
- Adjusted the run method in QueryRouterServer for consistent type definitions.
- Improved getList method in QueryRouter to allow filtering of routes.
2025-12-17 11:31:52 +08:00
2025-10-22 17:05:20 +08:00
2025-05-14 21:04:25 +08:00
2025-05-14 21:04:25 +08:00
2025-10-14 19:15:18 +08:00
2025-04-18 01:16:06 +08:00
2025-12-09 14:08:42 +08:00
2025-07-26 20:38:49 +08:00
2025-05-14 21:04:25 +08:00

router

import { App } from '@kevisual/router';

const app = new App();
app.listen(4002);

app
  .route({path:'demo', key: '02})
  .define(async (ctx) => {
    ctx.body = '02';
  })
  .addTo(app);

app
  .route('demo', '03')
  .define(async (ctx) => {
    ctx.body = '03';
  })
  .addTo(app);

兼容服务器

import { App } from '@kevisual/router';

const app = new App();
app.listen(4002);
import { proxyRoute, initProxy } from '@kevisual/local-proxy/proxy.ts';
initProxy({
  pagesDir: './demo',
  watch: true,
});

app.onServerRequest(proxyRoute);
Description
No description provided
Readme 730 KiB
Languages
TypeScript 97.4%
JavaScript 2.6%