
- 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
20 lines
498 B
TypeScript
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;
|