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
|
||||
VITE_BYPASS_TUTORIAL=0
|
||||
# Production environment
|
||||
VITE_ENVIRONMENT="production"
|
||||
VITE_API_BASE_URL="api"
|
||||
VITE_BYPASS_LOGIN=false
|
||||
VITE_BYPASS_TUTORIAL=false
|
@ -1,2 +1,5 @@
|
||||
VITE_BYPASS_LOGIN=1
|
||||
VITE_BYPASS_TUTORIAL=0
|
||||
# Development environment
|
||||
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 isLocal = window.location.hostname === 'localhost';
|
||||
export const serverUrl = isLocal ? 'http://localhost:8001' : '';
|
||||
export const apiUrl = isLocal ? serverUrl : 'api';
|
||||
export const isLocal = import.meta.env.VITE_ENVIRONMENT === 'local';
|
||||
export const apiUrl = import.meta.env.VITE_API_BASE_URL || (!isLocal ? 'api' : '');
|
||||
|
||||
export function setCookie(cName: string, cValue: string): void {
|
||||
const expiration = new Date();
|
||||
|
5
vite.env.d.ts
vendored
5
vite.env.d.ts
vendored
@ -1,9 +1,10 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_BYPASS_LOGIN: string;
|
||||
readonly VITE_BYPASS_TUTORIAL: string;
|
||||
readonly VITE_ENVIRONMENT: string;
|
||||
readonly VITE_API_BASE_URL: string;
|
||||
readonly VITE_BYPASS_LOGIN: boolean;
|
||||
readonly VITE_BYPASS_TUTORIAL: boolean;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
|
Loading…
Reference in New Issue
Block a user