init router

This commit is contained in:
2024-10-16 00:47:30 +08:00
commit 733677f3f3
32 changed files with 2185 additions and 0 deletions

31
readme.md Normal file
View File

@@ -0,0 +1,31 @@
# router
```
import { App } from '@kevisual/router';
const app = new App();
app.listen(4002);
new app.Route('demo', '01')
.define(async (ctx) => {
ctx.body = '01';
return ctx;
})
.addTo(app);
app
.route({path:'demo', key: '02})
.define(async (ctx) => {
ctx.body = '02';
return ctx;
})
.addTo(app);
app
.route('demo', '03')
.define(async (ctx) => {
ctx.body = '03';
return ctx;
})
.addTo(app);
```