This commit is contained in:
2025-08-13 22:53:50 +08:00
commit ec5e7a7ae4
11 changed files with 340 additions and 0 deletions

6
auto-demo/demo/demo.ts Normal file
View File

@@ -0,0 +1,6 @@
import { AutoData } from '../../src/auto-proxy/index.ts'
const autoData: AutoData = {
id: 'demo',
}

12
auto-demo/demo/index.ts Normal file
View File

@@ -0,0 +1,12 @@
import { listenSocket, QueryRouterServer } from '@kevisual/router/auto.ts'
const app = new QueryRouterServer();
app.route({
path: 'demo'
}).define(async (ctx) => {
ctx.body = 'Hello, this is the demo route!';
}).addTo(app);
listenSocket({ app, timeout: 10 * 60 * 1000 });

View File

@@ -0,0 +1,10 @@
{
"name": "auto-demo",
"version": "0.0.1",
"app": {
"key": "auto",
"entry": "index.ts",
"engine": "bun",
"type": "pm2-system-app"
}
}

View File

@@ -0,0 +1,8 @@
import { callSock } from "@kevisual/router/src/auto/call-sock.ts";
callSock({ path: 'demo' }, {
// socketPath: '../app.sock',
}).then((resp) => {
console.log(resp);
});