update
This commit is contained in:
25
server/src/app.ts
Normal file
25
server/src/app.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
Reference in New Issue
Block a user