Files
dnake/server/src/app.ts
xiao.xiong 39a70de606 update
2025-10-19 23:46:41 +08:00

25 lines
551 B
TypeScript

import { App } from '@kevisual/router'
import { sendDefaultSipMessage } from './lib.ts';
const app = new App();
// http://localhost:3001/api/router?path=floor
app.route({
path: 'floor'
}).define(async (ctx) => {
await sendDefaultSipMessage();
ctx.body = 'SIP消息已发送';
}).addTo(app)
app.route({
path: 'test'
}).define(async (ctx) => {
ctx.body = 'SIP消息已发送';
}).addTo(app)
app.listen(3001, "::", () => {
console.log('Server is running on http://localhost:3001');
})
// curl http://localhost:3001/api/router?path=test