Skip to content

Commit 633b041

Browse files
mikevelkoroot
andauthored
origin taken from window location (#14)
* workflow * nvmrc added * step to install buf * fix for make proto * install go and protoc-gen-typescript-http * added go update * fix * fix * fix * 404 html * removed homepage * react location history * test without custom 404 * removed custom 404 page * backend base path * backend base path * echo secret * echo secret remove * origin added hardcoded * console log to check base url * fix * revert * react app fix env name * webpack prod * fix * fix * secret replacved with env * revert * origin fix --------- Co-authored-by: root <root@mikevelko>
1 parent 6a23b44 commit 633b041

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/api/api.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,11 @@ import { ROUTES } from 'constants/routes';
33

44
const BASE_URL = process.env.REACT_APP_SERVER_URL;
55

6-
// check how to take origin from window browser
7-
let originUrl;
8-
if (process.env.NODE_ENV === 'development') {
9-
originUrl = 'http://localhost:4040';
10-
} else {
11-
12-
originUrl = 'https://mikevelko.github.io/grbpwr-admin-client/';
13-
}
14-
156
const axiosInstance = axios.create({
167
baseURL: BASE_URL,
178
headers: {
189
'Content-Type': 'application/json',
19-
'Origin': originUrl
10+
'Origin': window.location.origin
2011
},
2112
});
2213

0 commit comments

Comments
 (0)