添加前后端

This commit is contained in:
小贺
2025-08-31 18:43:16 +08:00
parent 62bab70b08
commit 8de03156e1
28 changed files with 4161 additions and 0 deletions

25
front/vite.config.ts Normal file
View File

@@ -0,0 +1,25 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
server: {
// 监听所有IP地址
host: "0.0.0.0",
// 指定dev sever的端口号
port: 3000,
// 自动打开浏览器运行以下页面
open: "/",
// 设置反向代理
proxy: {
// 以下示例表示请求URL中含有"/api"则反向代理到http://localhost
// 例如: http://localhost:3000/api/login -> http://localhost/api/login
"/api": {
target: "http://localhost:5000/",
changeOrigin: true,
},
},
},
});