1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-10 11:24:35 +00:00

fix(web): add proper base url in axios.defaults

This commit is contained in:
2023-03-01 21:45:18 +05:00
parent 737b34567e
commit 5e3ce8a98f

View File

@@ -9,7 +9,9 @@ import axios from 'axios'
const NODE_ENV = process.env.NODE_ENV
const PORT_API = process.env.PORT_API
const baseUrl =
NODE_ENV === 'development' ? `http://localhost:${PORT_API ?? 5000}` : ''
NODE_ENV === 'development'
? `http://localhost:${PORT_API ?? 5000}`
: window.location.origin + window.location.pathname
axios.defaults = Object.assign(axios.defaults, {
withCredentials: true,