Skip to content

Commit

Permalink
chore: code refactor for runtime env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
pratapalakshmi committed Nov 9, 2024
1 parent 67ba0f0 commit 79908d6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
2 changes: 1 addition & 1 deletion apps/kyb-app/src/common/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ky, { HTTPError } from 'ky';

export const request = ky.create({
//@ts-ignore
prefixUrl: globalThis.env.VITE_API_URL,
prefixUrl: globalThis.env.VITE_API_URL || `${window.location.origin}/api/v1/`,
retry: {
limit: 1,
statusCodes: [500, 408, 404, 404, 403, 401],
Expand Down
7 changes: 0 additions & 7 deletions apps/kyb-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import { App } from './App';
import { Head } from './Head';
import './i18next';
import './index.css';
import { initializeMonitoring } from '@/initialize-monitoring/initialize-monitoring';
import '../public/config.js?url';

try {
initializeMonitoring();
Expand All @@ -40,8 +38,3 @@ ReactDOM.createRoot(document.getElementById('root')!).render(
</HelmetProvider>
</React.StrictMode>,
);

//@ts-ignore
globalThis.env = globalThis.env || {
API_URL: import.meta.env.VITE_API_URL,
};

0 comments on commit 79908d6

Please sign in to comment.