update
This commit is contained in:
21
src/demo.ts
Normal file
21
src/demo.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import { App } from '@kevisual/router';
|
||||
|
||||
const app = new App();
|
||||
|
||||
app.route({
|
||||
description: 'Demo route',
|
||||
id: 'abc'
|
||||
}).define(async (ctx) => {
|
||||
ctx.body = 'Hello, Kevisual Router!';
|
||||
}).addTo(app);
|
||||
|
||||
|
||||
app.router.createRouteList()
|
||||
app.call({
|
||||
path: 'route',
|
||||
key: 'list'
|
||||
}).then((res) => {
|
||||
console.log('Registered res:', res);
|
||||
}).catch((error) => {
|
||||
console.error('Error fetching res:', error);
|
||||
});
|
||||
Reference in New Issue
Block a user