feat(frontend): support separate browser and server API base URLs

Add NUXT_SERVER_API_BASE_URL for internal server-side API requests
Update API and i18n services to select base URL by execution context
This commit is contained in:
2026-05-06 09:31:11 +08:00
parent 6e8edbbb09
commit afed409127
9 changed files with 111 additions and 29 deletions

View File

@@ -9,8 +9,10 @@ COPY frontend ./frontend
COPY system-wordings.ts ./system-wordings.ts
ARG NUXT_PUBLIC_API_BASE_URL=http://localhost:3001
ARG NUXT_SERVER_API_BASE_URL=http://localhost:3001
ARG NUXT_PUBLIC_SITE_URL=https://pokopiawiki.tootaio.com
ENV NUXT_PUBLIC_API_BASE_URL=$NUXT_PUBLIC_API_BASE_URL
ENV NUXT_SERVER_API_BASE_URL=$NUXT_SERVER_API_BASE_URL
ENV NUXT_PUBLIC_SITE_URL=$NUXT_PUBLIC_SITE_URL
RUN pnpm --filter @pokopia/frontend build