From 5d11f3fb7059c6cfcc95ffce4b7c1f1ceab963e9 Mon Sep 17 00:00:00 2001 From: AudunSorheim Date: Wed, 15 Nov 2023 12:17:07 +0100 Subject: [PATCH] Refactor decorator env --- nais/nais-demo.yaml | 2 -- nais/nais-dev.yaml | 2 -- nais/nais-prod.yaml | 2 -- src/pages/_document.tsx | 4 ++-- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/nais/nais-demo.yaml b/nais/nais-demo.yaml index 55440e36..e4fe29bc 100644 --- a/nais/nais-demo.yaml +++ b/nais/nais-demo.yaml @@ -43,8 +43,6 @@ spec: ingresses: - {{ingress}} env: - - name: DECORATOR_ENV - value: "prod" - name: AKTIVITETSKRAV_BACKEND_HOST value: "http://aktivitetskrav-backend.team-esyfo" - name: MIN_SIDE_ROOT diff --git a/nais/nais-dev.yaml b/nais/nais-dev.yaml index d750bc7f..928faa6b 100644 --- a/nais/nais-dev.yaml +++ b/nais/nais-dev.yaml @@ -44,8 +44,6 @@ spec: env: - name: DECORATOR_URL value: "https://dekoratoren.dev.nav.no" - - name: DECORATOR_ENV - value: "dev" - name: AKTIVITETSKRAV_BACKEND_HOST value: "http://aktivitetskrav-backend.team-esyfo" - name: AKTIVITETSKRAV_BACKEND_CLIENT_ID diff --git a/nais/nais-prod.yaml b/nais/nais-prod.yaml index eaaec8d0..52e7bed0 100644 --- a/nais/nais-prod.yaml +++ b/nais/nais-prod.yaml @@ -44,8 +44,6 @@ spec: env: - name: DECORATOR_URL value: "https://nav.no/dekoratoren" - - name: DECORATOR_ENV - value: "prod" - name: AKTIVITETSKRAV_BACKEND_HOST value: "http://aktivitetskrav-backend.team-esyfo" - name: AKTIVITETSKRAV_BACKEND_CLIENT_ID diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx index 8adeda34..09d0d890 100644 --- a/src/pages/_document.tsx +++ b/src/pages/_document.tsx @@ -11,7 +11,6 @@ import Document, { NextScript, } from "next/document"; import { AktivitetspliktCrumbs } from "@/breadcrumbs/breadcrumbs"; -import serverEnv from "@/env/serverEnv"; // The 'head'-field of the document initialProps contains data from (meta-tags etc) const getDocumentParameter = ( @@ -32,7 +31,8 @@ export default class MyDocument extends Document { const initialProps = await Document.getInitialProps(ctx); const Decorator = await fetchDecoratorReact({ - env: serverEnv.DECORATOR_ENV, + env: + process.env.NEXT_PUBLIC_RUNTIME_ENVIRONMENT === "prod" ? "prod" : "dev", params: { context: "privatperson", chatbot: true,