Skip to content

Commit

Permalink
fix/accessing VITE_API_HOST from window
Browse files Browse the repository at this point in the history
  • Loading branch information
nagstler committed Apr 29, 2024
1 parent 7505f8f commit e8363dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion ui/src/global.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
interface Window {
monaco: typeof import('monaco-editor');
VITE_API_HOST?: string;
}
8 changes: 3 additions & 5 deletions ui/src/services/axios.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import axios from 'axios';
import Cookies from 'js-cookie';

const DOMAIN = window?.VITE_API_HOST
? `${window?.VITE_API_HOST}/api/v1/`
: import.meta.env.VITE_API_HOST
? `${import.meta.env.VITE_API_HOST}/api/v1/`
: 'http://localhost:3000/api/v1/';
const DOMAIN = import.meta.env.VITE_API_HOST
? `${import.meta.env.VITE_API_HOST}/api/v1/`
: 'http://localhost:3000/api/v1/';

export const domain = DOMAIN;
export const axiosInstance = axios.create({
Expand Down

0 comments on commit e8363dc

Please sign in to comment.