Perplexica/ui/lib/config.ts
Hristo e6c2042df6 Backend GKE Deploy, access key for backend
- Configs and automation for deploying backend to GKE
- First steps to adding an optional token check for requests to backend
- First steps frontend sending optional token to backend when configured
2024-05-10 16:07:58 -04:00

20 lines
498 B
TypeScript

interface Config {
GENERAL: {
SUPER_SECRET_KEY: string;
NEXT_PUBLIC_API_URL: string;
};
}
const loadEnv = () => {
return {
GENERAL: {
SUPER_SECRET_KEY: process.env.SUPER_SECRET_KEY!,
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL!,
NEXT_PUBLIC_WS_URL: process.env.NEXT_PUBLIC_WS_URL!
},
} as Config;
};
export const getAccessKey = () => loadEnv().GENERAL.SUPER_SECRET_KEY;
export const getBackendURL = () => loadEnv().GENERAL.NEXT_PUBLIC_API_URL;