This commit is contained in:
2025-10-14 15:16:41 +08:00
parent e8794912b6
commit 27b63e0a2b
6 changed files with 89 additions and 40 deletions

25
src/test/ws.ts Normal file
View File

@@ -0,0 +1,25 @@
import { App } from "../app.ts";
const app = new App({
io: true
});
app
.route('demo', '03')
.define(async (ctx) => {
ctx.body = '03';
return ctx;
})
.addTo(app);
app
.route('test', 'test')
.define(async (ctx) => {
ctx.body = 'test';
return ctx;
})
.addTo(app);
console.log(`http://localhost:4002/api/router?path=demo&key=03`);
app.listen(4002, () => {
console.log("Server started on http://localhost:4002");
});