File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -2,18 +2,17 @@ import axios from 'axios'
22import { getToken , setToken } from './common'
33import { 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 /
1211export 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
You can’t perform that action at this time.
0 commit comments