This commit is contained in:
@@ -39,11 +39,20 @@ export default defineNuxtConfig({
|
||||
|
||||
runtimeConfig: {
|
||||
public: {
|
||||
// Override with NUXT_PUBLIC_API_BASE in production
|
||||
apiBase: process.env.NUXT_PUBLIC_API_BASE || 'http://localhost:5000',
|
||||
// Where the UI calls the API. The Docker image sets this to "" so the
|
||||
// browser calls /api on its own origin and nginx routes it to the
|
||||
// backend; dev keeps the absolute localhost address.
|
||||
apiBase: process.env.NUXT_PUBLIC_API_BASE ?? 'http://localhost:5000',
|
||||
},
|
||||
},
|
||||
|
||||
// The Nuxt server's own API calls (SSR) are relative once apiBase is "",
|
||||
// and land on this Nitro route, which forwards them to the backend. The
|
||||
// Docker image bakes NUXT_API_PROXY_TARGET=http://backend:5000 in at build.
|
||||
routeRules: {
|
||||
'/api/**': { proxy: `${process.env.NUXT_API_PROXY_TARGET || 'http://localhost:5000'}/api/**` },
|
||||
},
|
||||
|
||||
app: {
|
||||
head: {
|
||||
meta: [
|
||||
|
||||
Reference in New Issue
Block a user