Skip to content

Commit

Permalink
Make MPM Backend URL customisable (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmohns authored Mar 4, 2024
1 parent ccd0815 commit e3f7e70
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Website/ui/src/repositories/Client/AxiosClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ import axios from 'axios'
import {config} from '@/config'

function getBaseUrl () {
if (config.env === 'development') {
return `${window.location.protocol}//api.${window.location.hostname}`
const baseUrlFromEnv = process.env.VUE_APP_MPM_BACKEND_URL

if (baseUrlFromEnv) {
return baseUrlFromEnv
} else {
if (config.env === 'development') {
return `${window.location.protocol}//api.${window.location.hostname}`
}
return window.location.protocol + '//' + window.location.hostname
}
return window.location.protocol + '//' + window.location.hostname
}

export const baseUrl = getBaseUrl()
Expand Down

0 comments on commit e3f7e70

Please sign in to comment.