diff --git a/src/shared/fetchWrapper.js b/src/shared/fetchWrapper.js index bd3a462..d128320 100644 --- a/src/shared/fetchWrapper.js +++ b/src/shared/fetchWrapper.js @@ -2,7 +2,7 @@ import {registrationStore} from '../store/store'; function prepareUrl(url) { if (url.startsWith('http')) return url; - return `http://3.125.47.101/api/${url}`; + return `${window.location.origin}/api/${url}`; } function handleRequest(method, url, headers, attempts, token, body) { diff --git a/webpack.config.js b/webpack.config.js index 66655ac..bbd75ab 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -38,6 +38,13 @@ module.exports = { client: { progress: true, }, + proxy: { + '/api/**': { + target: 'http://3.125.47.101', + secure: false, + changeOrigin: true + } + } }, module: {