mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 16:32:16 +02:00
Merge branch 'chore/env-config-updates' into dev
This commit is contained in:
commit
bf1233d7ad
7
.env
7
.env
@ -1,2 +1,5 @@
|
|||||||
VITE_BYPASS_LOGIN=0
|
# Production environment
|
||||||
VITE_BYPASS_TUTORIAL=0
|
VITE_ENVIRONMENT="production"
|
||||||
|
VITE_API_BASE_URL="api"
|
||||||
|
VITE_BYPASS_LOGIN=false
|
||||||
|
VITE_BYPASS_TUTORIAL=false
|
@ -1,2 +1,5 @@
|
|||||||
VITE_BYPASS_LOGIN=1
|
# Development environment
|
||||||
VITE_BYPASS_TUTORIAL=0
|
VITE_ENVIRONMENT="local"
|
||||||
|
VITE_API_BASE_URL="http://localhost:8001"
|
||||||
|
VITE_BYPASS_LOGIN=true
|
||||||
|
VITE_BYPASS_TUTORIAL=false
|
@ -210,9 +210,8 @@ export function executeIf<T>(condition: boolean, promiseFunc: () => Promise<T>):
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const sessionIdKey = 'pokerogue_sessionId';
|
export const sessionIdKey = 'pokerogue_sessionId';
|
||||||
export const isLocal = window.location.hostname === 'localhost';
|
export const isLocal = import.meta.env.VITE_ENVIRONMENT === 'local';
|
||||||
export const serverUrl = isLocal ? 'http://localhost:8001' : '';
|
export const apiUrl = import.meta.env.VITE_API_BASE_URL || (!isLocal ? 'api' : '');
|
||||||
export const apiUrl = isLocal ? serverUrl : 'api';
|
|
||||||
|
|
||||||
export function setCookie(cName: string, cValue: string): void {
|
export function setCookie(cName: string, cValue: string): void {
|
||||||
const expiration = new Date();
|
const expiration = new Date();
|
||||||
|
5
vite.env.d.ts
vendored
5
vite.env.d.ts
vendored
@ -1,9 +1,10 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly VITE_BYPASS_LOGIN: string;
|
readonly VITE_ENVIRONMENT: string;
|
||||||
readonly VITE_BYPASS_TUTORIAL: string;
|
|
||||||
readonly VITE_API_BASE_URL: string;
|
readonly VITE_API_BASE_URL: string;
|
||||||
|
readonly VITE_BYPASS_LOGIN: boolean;
|
||||||
|
readonly VITE_BYPASS_TUTORIAL: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
|
Loading…
Reference in New Issue
Block a user