feat: add QueryRouterServer
This commit is contained in:
22
demo/simple/src/browser/app.ts
Normal file
22
demo/simple/src/browser/app.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { QueryRouterServer } from '@kevisual/router';
|
||||
|
||||
const router = new QueryRouterServer();
|
||||
|
||||
router
|
||||
.route({
|
||||
path: 'hello',
|
||||
key: 'world',
|
||||
})
|
||||
.define(async (ctx) => {
|
||||
ctx.body = 'Hello, world!';
|
||||
})
|
||||
.addTo(router);
|
||||
|
||||
router
|
||||
.run({
|
||||
path: 'hello',
|
||||
key: 'world',
|
||||
})
|
||||
.then((res) => {
|
||||
console.log(res);
|
||||
});
|
Reference in New Issue
Block a user