Skip to content

Commit

Permalink
Merge pull request EGCETSII#71 from Full-Tortuga/fix/EGCETSII#69-fron…
Browse files Browse the repository at this point in the history
…tend-api-url

EGCETSII#69-fix: make api url dynamic
  • Loading branch information
pedalopon authored Jan 7, 2022
2 parents 7c89cf1 + 76672e2 commit d93bb3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion decide/administration/frontend/src/api/axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import Axios from "axios";

import { sessionUtils } from "utils";

const API_URL = "http://localhost:8000/administration/api";
const BASE_URL = window.location.href.includes("localhost")
? "http://localhost:8000/administration"
: window.location.origin + "/administration";

const API_URL = BASE_URL + "/api";

export const axios = Axios.create({
baseURL: API_URL,
Expand Down

0 comments on commit d93bb3f

Please sign in to comment.