Skip to content

Commit

Permalink
Fix build-client.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoutsilis committed Mar 10, 2024
1 parent f174f1c commit 1f51f0f
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions client/api/build-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,14 @@ import axios from "axios";
export default ({ req }) => {
if (typeof window === "undefined") {
//on the server
// TODO: Probably need to improve that,
// but this is a future Konstantinos problem :)
if (process.env.APP_ENV.toLowerCase() === "development") {
return axios.create({
baseURL:
"http://ingress-nginx-controller.ingress-nginx.svc.cluster.local",
headers: req.headers,
});
} else {
return axios.create({
baseURL: "http://www.tixmix.store/",
});
}
const isDevelopment = process.env.APP_ENV.toLowerCase() === 'development';
const baseURL = isDevelopment
? 'http://ingress-nginx-controller.ingress-nginx.svc.cluster.local'
: 'http://www.tixmix.store';
return axios.create({
baseURL,
headers: req.headers,
});
} else {
return axios.create({ baseURL: "/" });
}
Expand Down

0 comments on commit 1f51f0f

Please sign in to comment.