diff --git a/server/index.js b/server/index.js index 70f49a730..59bd12baa 100644 --- a/server/index.js +++ b/server/index.js @@ -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);