init
This commit is contained in:
6
auto-demo/demo/demo.ts
Normal file
6
auto-demo/demo/demo.ts
Normal 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
12
auto-demo/demo/index.ts
Normal 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 });
|
||||
10
auto-demo/demo/package.json
Normal file
10
auto-demo/demo/package.json
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "auto-demo",
|
||||
"version": "0.0.1",
|
||||
"app": {
|
||||
"key": "auto",
|
||||
"entry": "index.ts",
|
||||
"engine": "bun",
|
||||
"type": "pm2-system-app"
|
||||
}
|
||||
}
|
||||
8
auto-demo/demo/test/call.ts
Normal file
8
auto-demo/demo/test/call.ts
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user