20 lines
626 B
TypeScript
20 lines
626 B
TypeScript
import { app } from './app.ts';
|
|
import './route.ts';
|
|
import { handleRequest } from './routes-simple/handle-request.ts';
|
|
import { port } from './modules/config.ts';
|
|
import { wssFun } from './modules/ws-proxy/index.ts';
|
|
import { WebSocketListenerFun, HttpListenerFun } from '@kevisual/router/src/server/server-type.js';
|
|
console.log('Starting server...', port);
|
|
app.listen(port, '0.0.0.0', () => {
|
|
console.log(`server is running at http://localhost:${port}`);
|
|
});
|
|
app.server.on([{
|
|
id: 'handle-all',
|
|
func: handleRequest as any,
|
|
}, {
|
|
id: 'wss',
|
|
io: true,
|
|
path: '/ws/proxy',
|
|
func: wssFun as WebSocketListenerFun,
|
|
}]);
|