Skip to content

Commit

Permalink
apiClient fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Keskimaki committed Apr 27, 2023
1 parent 436f9e9 commit 1c70251
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/client/util/apiClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@ import axios from 'axios'

import { PUBLIC_URL } from '../../config'

const getApiClient = () => {
const isPublicVersion = window.location.href.includes('/public')
const isPublicVersion = window.location.href.includes('/public')

const baseURL = isPublicVersion
? `${PUBLIC_URL}/api`
: `${PUBLIC_URL}/public/api`
const baseURL = isPublicVersion
? `${PUBLIC_URL}/public/api`
: `${PUBLIC_URL}/api`

const apiClient = axios.create({ baseURL })
const apiClient = axios.create({ baseURL })

return apiClient
}

export default getApiClient()
export default apiClient

0 comments on commit 1c70251

Please sign in to comment.