chore(frontend): update .dockerignore and .gitignore to correct lib directory entry; add new utility and file handling modules

This commit is contained in:
Davidson Gomes
2025-05-24 11:00:55 -03:00
parent eb7bb06ef3
commit b4939b0fca
5 changed files with 362 additions and 2 deletions

15
frontend/lib/env.ts Normal file
View File

@@ -0,0 +1,15 @@
import { env } from 'next-runtime-env';
export const getEnv = (key: string, defaultValue?: string): string => {
try {
const value = env(key);
return value || defaultValue || '';
} catch (error) {
console.error(`Error getting environment variable ${key}:`, error);
return defaultValue || '';
}
};
export const getApiUrl = (): string => {
return getEnv('NEXT_PUBLIC_API_URL', 'https://api-evoai.evoapicloud.com');
};