Change API variable name

This commit is contained in:
Hydroxycarbamide 2022-07-30 20:24:58 +02:00
parent 2fc6e78f49
commit 60dc0b56bb
4 changed files with 5 additions and 4 deletions

View file

@ -1 +1 @@
VITE_SMARTMENUISERIE_URL=https://localhost/SmartMenuiserieTemplate VITE_API_URL=http://localhost:5000

View file

@ -1,2 +1,2 @@
VITE_SMARTMENUISERIE_URL=https://localhost/SmartMenuiserieTemplate VITE_API_URL=https://localhost/SmartMenuiserieTemplate

View file

@ -11,6 +11,7 @@ interface IAppProps {
interface IAppState { interface IAppState {
componentOptions: IAvailableContainerModel[] componentOptions: IAvailableContainerModel[]
} }
class App extends React.Component<IAppProps> { class App extends React.Component<IAppProps> {
public state: IAppState; public state: IAppState;
@ -39,7 +40,7 @@ class App extends React.Component<IAppProps> {
} }
async function fetchConfiguration(): Promise<IConfigurationResponseModel> { async function fetchConfiguration(): Promise<IConfigurationResponseModel> {
const url = `${import.meta.env.VITE_SMARTMENUISERIE_URL}`; const url = `${import.meta.env.VITE_API_URL}`;
const myHeaders = new Headers({ const myHeaders = new Headers({
'Content-Type': 'application/json' 'Content-Type': 'application/json'
}); });

2
src/vite-env.d.ts vendored
View file

@ -1,7 +1,7 @@
/// <reference types="vite/client" /> /// <reference types="vite/client" />
interface ImportMetaEnv { interface ImportMetaEnv {
readonly VITE_SMARTMENUISERIE_URL: string readonly VITE_API_URL: string
// more env variables... // more env variables...
} }