more env stuff
All checks were successful
CI/CD Pipeline / Build and Push App Docker Image (push) Successful in 1m18s
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 7s
CI/CD Pipeline / Deploy to Kubernetes (push) Successful in 41s

This commit is contained in:
yohlo
2026-02-09 12:07:45 -06:00
parent 243fb094e1
commit 70a032db20
4 changed files with 48 additions and 8 deletions

19
src/lib/config.ts Normal file
View File

@@ -0,0 +1,19 @@
import { createServerFn } from '@tanstack/react-start'
export const getConfig = createServerFn({ method: 'GET' }).handler(async () => {
return {
apiDomain: process.env.VITE_API_DOMAIN || 'http://localhost:3000',
websiteDomain: process.env.VITE_WEBSITE_DOMAIN || 'http://localhost:3000',
spotifyClientId: process.env.VITE_SPOTIFY_CLIENT_ID || '',
spotifyRedirectUri: process.env.VITE_SPOTIFY_REDIRECT_URI || '',
}
})
export const serverConfig = {
apiDomain: process.env.VITE_API_DOMAIN || 'http://localhost:3000',
websiteDomain: process.env.VITE_WEBSITE_DOMAIN || 'http://localhost:3000',
supertokensUri: process.env.SUPERTOKENS_URI || 'http://localhost:3567',
pocketbaseUrl: process.env.POCKETBASE_URL || 'http://localhost:8090',
spotifyClientId: process.env.VITE_SPOTIFY_CLIENT_ID || '',
spotifyClientSecret: process.env.SPOTIFY_CLIENT_SECRET || '',
}

View File

@@ -1,7 +1,14 @@
const getOrigin = (): string => {
if (typeof window !== 'undefined') {
return window.location.origin;
}
return process.env.VITE_API_DOMAIN || 'http://localhost:3000';
};
export const appInfo = {
appName: 'FLXN',
apiDomain: process.env.VITE_API_DOMAIN || 'http://localhost:3000',
websiteDomain: process.env.VITE_WEBSITE_DOMAIN || 'http://localhost:3000',
apiDomain: getOrigin(),
websiteDomain: getOrigin(),
apiBasePath: '/api/auth',
websiteBasePath: '/auth',
}