Files
web-nuxt/nuxt.config.ts
T
Noel Sabia b33e6ff001 feat: wire Nitro API to Go, real staffing plan and train proxy
- Replace mock Nitro routes with server-side proxies to the Go API
- /plan reads Go /api/staffing; local assumption edits are a labeled preview
- /simulate reads base and scenario staffing from Go instead of local multipliers
- Route train upload and scenario POST through Nitro with server-only credentials
- Keep NUXT_PUBLIC_USE_MOCK=1 as an explicit dev fallback only
- Match Go's global-peak flat schedule and add a captured Go parity fixture
- Run the web runtime as numeric UID/GID 10001:10001
- Add make check, Gitea CI workflow and a proxy smoke script
2026-11-14 06:13:00 +01:00

53 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const useMock =
(process.env.NUXT_PUBLIC_USE_MOCK ?? process.env.NUXT_USE_MOCK ?? '').toLowerCase() === 'true' ||
process.env.NUXT_PUBLIC_USE_MOCK === '1' ||
process.env.NUXT_USE_MOCK === '1'
export default defineNuxtConfig({
compatibilityDate: '2026-11-01',
ssr: true,
modules: ['@sit-onyx/nuxt'],
css: ['~/assets/css/main.css'],
devtools: { enabled: false },
runtimeConfig: {
// Server-side Go API. K8s sets NUXT_API_INTERNAL_BASE=http://api:8080.
apiBase:
process.env.NUXT_API_INTERNAL_BASE ??
process.env.NUXT_API_BASE ??
process.env.NUXT_PUBLIC_API_BASE ??
'http://localhost:8080',
apiTimeoutMs: Number(process.env.NUXT_API_TIMEOUT_MS ?? 8000),
// Explicit dev fallback. The default is the real Go API.
useMock,
// Server-only control credentials for POST /api/scenario and /api/train.
controlUser: process.env.CONTROL_USER ?? process.env.NUXT_CONTROL_USER ?? '',
controlPass: process.env.CONTROL_PASS ?? process.env.NUXT_CONTROL_PASS ?? '',
controlToken: process.env.CONTROL_TOKEN ?? process.env.NUXT_CONTROL_TOKEN ?? '',
public: {
// Browser never calls Go directly; this is for display/future SSE wiring.
apiBase: process.env.NUXT_PUBLIC_API_BASE ?? '',
useMock,
demoNow: process.env.NUXT_PUBLIC_DEMO_NOW ?? '2026-11-14T08:12:00Z',
},
},
app: {
head: {
htmlAttrs: { lang: 'en' },
title: 'PulseCast — next week’s staffing plan',
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{
name: 'description',
content:
'PulseCast turns inner-city footfall into a transparent next-week staffing plan for Heilbronn retailers.',
},
{ name: 'theme-color', content: '#0f766e' },
],
link: [{ rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
},
},
nitro: {
preset: 'node-server',
},
})