初始版本,目前线上可用

This commit is contained in:
2025-11-19 12:49:16 +08:00
commit cb7f1c45e8
178 changed files with 30336 additions and 0 deletions

24
backEnd/index.ts Normal file
View File

@@ -0,0 +1,24 @@
require("module-alias/register"); // 别名加载
import express from "express";
import bodyParser from "body-parser";
import routerIndex from "./src/router/index";
import { createConnection } from "typeorm";
import cors from "cors";
const app = express();
const port = 8101;
createConnection().then(() => {
console.log("数据库连接成功!");
app.listen(port, () => {
console.log(`开始监听${port}`);
});
});
app.use(bodyParser.urlencoded({ extended: true })); // 进行url解码
app.use(bodyParser.json());
app.use(cors());
// 匹配接口路由
app.use("/", routerIndex);