feat(arch): unify frontend and backend into single Go backend server with static export
- Configure Next.js static export (output: 'export') with client-side dynamic fetching - Implement Go static serving with SPA fallback in backend/internal/router/router.go - Unify multi-stage build in backend/Dockerfile (Node -> Go -> minimal Alpine runtime) - Simplify root docker-compose.yml to single anl-app service on port 8080 - Update REQUIREMENTS.md DM-03 and AC-17 normative contracts to v3.0 Unified Go Backend - Restore strict regression verification in Gate 9 (AC-35/36/37) and unittest suite - All Go unit tests, TypeScript type checks, ESLint, and E2E gates passed clean
This commit is contained in:
@@ -5,14 +5,10 @@
|
||||
|
||||
export function getAdminApiBaseUrl(): string {
|
||||
if (typeof window !== "undefined") {
|
||||
// Browser / CSR context: use public endpoint
|
||||
return (
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ||
|
||||
process.env.API_BASE_URL ||
|
||||
"http://localhost:8080/api/v1"
|
||||
);
|
||||
// Browser / CSR context: same-origin relative path by default.
|
||||
return process.env.NEXT_PUBLIC_API_BASE_URL || "/api/v1";
|
||||
}
|
||||
// Server / SSR context: prefer internal container DNS if available, fallback to NEXT_PUBLIC or localhost
|
||||
// Server / build-time context: defensive fallback during static prerendering
|
||||
return (
|
||||
process.env.API_BASE_URL ||
|
||||
process.env.NEXT_PUBLIC_API_BASE_URL ||
|
||||
|
||||
Reference in New Issue
Block a user