mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-22 08:59:39 +00:00
25 lines
771 B
JavaScript
25 lines
771 B
JavaScript
![]() |
if (process.env.REACT_APP_MOCK === 'true' || process.env.REACT_APP_MOCK === 'cy') {
|
||
|
// no proxy needed, MirageJS will intercept all http requests
|
||
|
module.exports = function () {};
|
||
|
} else {
|
||
|
// create a proxy to the graphql server running in docker container
|
||
|
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||
|
|
||
|
module.exports = function (app) {
|
||
|
app.use(
|
||
|
'/logIn',
|
||
|
createProxyMiddleware({
|
||
|
target: 'http://localhost:9002',
|
||
|
changeOrigin: true,
|
||
|
}),
|
||
|
);
|
||
|
app.use(
|
||
|
'/api/v2/graphql',
|
||
|
createProxyMiddleware({
|
||
|
target: 'http://localhost:9002',
|
||
|
changeOrigin: true,
|
||
|
}),
|
||
|
);
|
||
|
};
|
||
|
}
|