Skip to content

Commit

Permalink
Fix react FE
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas-Juri committed Feb 8, 2024
1 parent 4feb1f3 commit 8296cf4
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions 2024/React/Frontend/src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import axios, { AxiosError, AxiosInstance } from "axios";

const target = process.env.ASPNETCORE_HTTPS_PORT
? `https://localhost:${process.env.ASPNETCORE_HTTPS_PORT}`
: process.env.ASPNETCORE_URLS
? process.env.ASPNETCORE_URLS.split(";")[0]
: "https://localhost:7101/";

export const url = process.env.NODE_ENV === 'development' ? 'https://localhost:7125/' : '/';

export function api(): AxiosInstance {
const headers: { [key: string]: string } = {
Expand All @@ -17,7 +14,7 @@ export function api(): AxiosInstance {
}

const instance = axios.create({
baseURL: target,
baseURL: url,
headers,
});

Expand Down

0 comments on commit 8296cf4

Please sign in to comment.