Skip to content

Commit

Permalink
Refactor decorator env
Browse files Browse the repository at this point in the history
  • Loading branch information
AudunSorheim committed Nov 15, 2023
1 parent fe3bc3e commit 5d11f3f
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions nais/nais-demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions nais/nais-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions nais/nais-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <head> (meta-tags etc)
const getDocumentParameter = (
Expand All @@ -32,7 +31,8 @@ export default class MyDocument extends Document<Props> {
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,
Expand Down

0 comments on commit 5d11f3f

Please sign in to comment.