feat: init base module

This commit is contained in:
xion
2024-06-22 23:47:43 +08:00
commit 35f1182aec
18 changed files with 13328 additions and 0 deletions

13
src/app.ts Normal file
View File

@@ -0,0 +1,13 @@
import { useConfig } from '@abearxiong/use-config';
import { handleMessage } from './route.ts';
import { server as routerServer } from './modules/router.ts';
import http from 'http';
const config = useConfig();
routerServer.setHandle(handleMessage);
const server = http.createServer(routerServer.callback());
server.listen(config.port, () => {
console.log(`Server running at http://localhost:${config.port}/`);
});