90ecb8eb931d7bda8c18eb89c02866f9f601f28d
- 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.
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
Languages
TypeScript
97.4%
JavaScript
2.6%