Peiyan commited on
Commit
6245c39
·
unverified ·
1 Parent(s): 4503126

Create setupProxy.js

Browse files
Files changed (1) hide show
  1. frontend/src/setupProxy.js +14 -0
frontend/src/setupProxy.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const { createProxyMiddleware } = require('http-proxy-middleware')
2
+
3
+ module.exports = function (app) {
4
+ app.use(
5
+ '/api',
6
+ createProxyMiddleware({
7
+ target: 'http://127.0.0.1:5000',
8
+ changeOrigin: true,
9
+ pathRewrite: {
10
+ '^/api': '',
11
+ },
12
+ })
13
+ )
14
+ }