- Increase token expiry from 30 minutes to 7 days - Remove internal session.commit() calls from gamification services - Add try/except around gamification logic in review creation - Add elmeg.runfoo.run hostname support in frontend api-config
12 lines
407 B
TypeScript
12 lines
407 B
TypeScript
export function getApiUrl() {
|
|
if (typeof window === 'undefined') {
|
|
// Server-side
|
|
return process.env.INTERNAL_API_URL || 'http://localhost:8000'
|
|
}
|
|
// Client-side
|
|
const hostname = window.location.hostname
|
|
if (hostname === 'elmeg.xyz' || hostname === 'elmeg.runfoo.run') {
|
|
return '/api'
|
|
}
|
|
return process.env.NEXT_PUBLIC_API_URL || 'http://localhost:8000'
|
|
}
|