|
@@ -5,13 +5,9 @@ import { errorHandler } from "./middleware/errorHandler.js";
|
|
|
import exampleRoutes from "./routes/exampleRoutes.js";
|
|
|
import chartRoutes from "./routes/chartRoutes.js";
|
|
|
import path from "path";
|
|
|
-import { fileURLToPath } from "url";
|
|
|
// 引入 cors 模块
|
|
|
import cors from "cors";
|
|
|
|
|
|
-const __filename = fileURLToPath(import.meta.url);
|
|
|
-const __dirname = path.dirname(__filename);
|
|
|
-
|
|
|
const app = express();
|
|
|
// 使用 cors 中间件
|
|
|
app.use(cors());
|