跟新api

This commit is contained in:
30404 2024-06-20 16:27:20 +08:00
parent eacc60ea86
commit dfe838b7b0
2 changed files with 11 additions and 5 deletions

View File

@ -27,7 +27,6 @@ function SubjectPage(){
test() test()
},[]) },[])
const [EndTestList,setEndTestList]=useState([]) const [EndTestList,setEndTestList]=useState([])
// //
const end_test=async()=>{ const end_test=async()=>{

View File

@ -1,4 +1,11 @@
const proxy=require("http-proxy-middleware") const { createProxyMiddleware } = require('http-proxy-middleware');
module.exports=function(app){
app.use(proxy(['/api'],{target:"http://localhost:5000"})) module.exports = function(app) {
} app.use(
'/api', // 如果请求路径匹配'/api',则进行代理
createProxyMiddleware({
target: 'http://localhost:5000', // 目标后端服务地址
changeOrigin: true,
})
);
};