Files
comfy_backend/src/server.ts
2024-05-21 21:59:30 +08:00

18 lines
434 B
TypeScript

import Koa from "koa";
import router from "./routers/router";
import bodyParser from "koa-bodyparser";
import InitHandler from "./routers/handler";
// 使用路由
const app = new Koa();
app.use(bodyParser());
app.use(router.routes()).use(router.allowedMethods());
InitHandler();
console.log(router);
// 启动服务器
const PORT = 3000;
app.listen(PORT, () => {
console.log(`Server is running on http://localhost:${PORT}`);
});