This commit is contained in:
黄心宇 2024-04-17 10:41:56 +08:00
parent c0d1e08c17
commit aaecccf5d9
1 changed files with 3 additions and 1 deletions

View File

@ -6,7 +6,6 @@ const { createProxyMiddleware } = require('http-proxy-middleware');
const app = express();
app.use('/build', express.static('build'));
const proxy = createProxyMiddleware(options('http://localhost:8080'));
const options = (target) => {
return {
@ -20,6 +19,9 @@ const options = (target) => {
};
}
const proxy = createProxyMiddleware(options('http://localhost:8080'));
// 设置代理
// app.use(['/api/zone', '/api/cms'], (req, res) => {
// proxy(req, res);