khulnasoft commited on
Commit
17f9277
·
verified ·
1 Parent(s): 3ad8578

Create frontend/src/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
+ pathRewrite: {
8
+ '^/api': '',
9
+ },
10
+ target: 'http://localhost:7860',
11
+ changeOrigin: true,
12
+ })
13
+ );
14
+ };