Make api url configurable in index.html
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
import axios from 'axios'
|
||||
let config = require('../../public/config.json')
|
||||
|
||||
export const HTTP = axios.create({
|
||||
baseURL: config.VIKUNJA_API_BASE_URL
|
||||
baseURL: window.API_URL
|
||||
})
|
||||
|
@ -1,5 +1,4 @@
|
||||
import AbstractModel from './abstractModel'
|
||||
import config from '../../public/config'
|
||||
|
||||
export default class UserModel extends AbstractModel {
|
||||
constructor(data) {
|
||||
@ -19,6 +18,6 @@ export default class UserModel extends AbstractModel {
|
||||
}
|
||||
|
||||
getAvatarUrl(size = 50) {
|
||||
return `${config.VIKUNJA_API_BASE_URL}${this.username}/avatar?size=${size}`
|
||||
return `${window.API_URL}${this.username}/avatar?size=${size}`
|
||||
}
|
||||
}
|
@ -2,8 +2,6 @@ import axios from 'axios'
|
||||
import {reduce, replace} from 'lodash'
|
||||
import { objectToSnakeCase } from '../helpers/case'
|
||||
|
||||
let config = require('../../public/config.json')
|
||||
|
||||
export default class AbstractService {
|
||||
|
||||
/////////////////////////////
|
||||
@ -33,7 +31,7 @@ export default class AbstractService {
|
||||
*/
|
||||
constructor(paths) {
|
||||
this.http = axios.create({
|
||||
baseURL: config.VIKUNJA_API_BASE_URL,
|
||||
baseURL: window.API_URL,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
|
Reference in New Issue
Block a user