fix: simplify API_BASE, remove Docker SSR workaround

This commit is contained in:
Markov 2026-02-15 18:58:23 +01:00
parent 1d998dca55
commit a1b58ba916
2 changed files with 7 additions and 5 deletions

6
next-env.d.ts vendored Normal file
View File

@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

View File

@ -1,8 +1,4 @@
// SSR runs inside Docker → use internal service name; browser uses public URL
const API_BASE =
typeof window === "undefined"
? (process.env.API_INTERNAL_URL || "http://tracker:8100")
: (process.env.NEXT_PUBLIC_API_URL || "http://localhost:8100");
const API_BASE = process.env.NEXT_PUBLIC_API_URL || "http://localhost:8100";
async function request<T>(path: string, opts?: RequestInit): Promise<T> {
const res = await fetch(`${API_BASE}${path}`, {