add production values
This commit is contained in:
@@ -1,7 +1,11 @@
|
|||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
|
|
||||||
|
const API_BASE_URL = process.env.NODE_ENV === 'production'
|
||||||
|
? 'http://127.0.0.1:5010'
|
||||||
|
: 'http://127.0.0.1:5000'
|
||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: 'http://127.0.0.1:5000',
|
baseURL: API_BASE_URL,
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
},
|
},
|
||||||
@@ -34,7 +38,11 @@ api.interceptors.response.use(
|
|||||||
throw new Error('No refresh token')
|
throw new Error('No refresh token')
|
||||||
}
|
}
|
||||||
|
|
||||||
const { data } = await axios.post('http://127.0.0.1:5000/api/refresh-token', {
|
const refreshUrl = process.env.NODE_ENV === 'production'
|
||||||
|
? 'http://127.0.0.1:5010/api/refresh-token'
|
||||||
|
: 'http://127.0.0.1:5000/api/refresh-token'
|
||||||
|
|
||||||
|
const { data } = await axios.post(refreshUrl, {
|
||||||
refresh_token: refreshToken
|
refresh_token: refreshToken
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user