Skip to content

Commit 0d76982

Browse files
committed
Revert "Test direct route connection for frontend"
This reverts commit f36b3be.
1 parent f36b3be commit 0d76982

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

frontend/src/util/apiConnection.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ import axios from 'axios'
22
import { getToken, setToken } from './common'
33
import { TOKEN_NAME, DEV_USER } from './constants'
44

5-
/* const createApiUrl = (path) => {
5+
const createApiUrl = (path) => {
66
const API_PATHS = ['grappa']
77
const mode = path.split('/')[1]
8-
98
return API_PATHS.includes(mode) ? `/${mode}/api` : '/api'
10-
} */
9+
}
1110
// Problems with api base path: /v2 or /api or even /
1211
export const getAxios = () => {
13-
// const hostUrl = window.location.origin
14-
// const apiPath = createApiUrl(window.location.pathname)
12+
const hostUrl = window.location.origin
13+
const apiPath = createApiUrl(window.location.pathname)
1514
return axios.create({
16-
baseURL: 'https://grappa-mock.apps.ocp-prod-0.k8s.it.helsinki.fi'
15+
baseURL: `${hostUrl}${apiPath}`
1716
})
1817
}
1918

0 commit comments

Comments
 (0)