update add no path and random path

This commit is contained in:
2025-10-22 17:05:20 +08:00
parent 24166f9899
commit cc74dc6803
5 changed files with 85 additions and 9 deletions

28
demo/simple/src/nopath.ts Normal file
View File

@@ -0,0 +1,28 @@
import { Route, App } from '@kevisual/router/src/index.ts';
const app = new App();
app.route({
description: 'sdf'
}).define(async (ctx) => {
ctx.body = 'this is no path fns';
return ctx;
}).addTo(app);
let id = ''
console.log('routes', app.router.routes.map(item => {
id = item.id;
return {
path: item.path,
key: item.key,
id: item.id,
description: item.description
}
}))
app.call({id: id}).then(res => {
console.log('id', id);
console.log('res', res);
})