add proxy api

This commit is contained in:
kandrusyak
2022-08-01 14:07:23 +03:00
parent 826f340e9a
commit 344b2c7862
2 changed files with 8 additions and 1 deletions

View File

@@ -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) {

View File

@@ -38,6 +38,13 @@ module.exports = {
client: {
progress: true,
},
proxy: {
'/api/**': {
target: 'http://3.125.47.101',
secure: false,
changeOrigin: true
}
}
},
module: {