From 4d07c6af59ec67ee46debaffca693c75de69c239 Mon Sep 17 00:00:00 2001 From: Markus Johansen Date: Wed, 12 Jul 2023 18:20:37 +0200 Subject: [PATCH 1/7] =?UTF-8?q?=E2=9C=A8Lagt=20til=20intern=20navbar=20med?= =?UTF-8?q?=20tittel=20"Sprik"=20p=C3=A5=20hovedside=20og=20feilinnmelding?= =?UTF-8?q?side?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/components/Header.tsx | 21 +++++++++++++++++++++ frontend/pages/feil/index.tsx | 5 ++--- frontend/pages/index.tsx | 3 ++- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 frontend/components/Header.tsx diff --git a/frontend/components/Header.tsx b/frontend/components/Header.tsx new file mode 100644 index 0000000..06e0c41 --- /dev/null +++ b/frontend/components/Header.tsx @@ -0,0 +1,21 @@ +import { MenuGridIcon } from "@navikt/aksel-icons" +import { InternalHeader, Dropdown } from "@navikt/ds-react" + +const Header = () => { + return( + + + Sprik + + + + + + {/* */} + + + ) +} +export default Header \ No newline at end of file diff --git a/frontend/pages/feil/index.tsx b/frontend/pages/feil/index.tsx index 19fd690..b84a9d1 100644 --- a/frontend/pages/feil/index.tsx +++ b/frontend/pages/feil/index.tsx @@ -5,6 +5,7 @@ import { Button, Heading, TextField, Textarea } from "@navikt/ds-react"; import post from "../api/http"; import { useState } from "react"; import router from "next/router"; +import Header from "@/components/Header"; export default function Feil() { const [tittel, setTittel] = useState(""); @@ -23,9 +24,7 @@ export default function Feil() { return (
- -
- +
diff --git a/frontend/pages/index.tsx b/frontend/pages/index.tsx index 7ba250b..eec4049 100644 --- a/frontend/pages/index.tsx +++ b/frontend/pages/index.tsx @@ -1,4 +1,5 @@ import CardsContainer from "@/components/CardsContainer"; +import Header from "@/components/Header"; import "@navikt/ds-css"; import { Button, Heading, Search } from "@navikt/ds-react"; import router from "next/router"; @@ -10,7 +11,7 @@ export default function Home() { return (
-
+
From 2197a1b5b03954ccc44a583aaebe4a6cea4ea6b3 Mon Sep 17 00:00:00 2001 From: Sindre Kjelsrud Date: Thu, 13 Jul 2023 09:56:16 +0200 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=94=A7=20Riktig=20brukernavn=20og=20p?= =?UTF-8?q?assord=20ved=20auth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Markus A. R. Johansen Co-authored-by: Amalie Erdal Mansåker Co-authored-by: Helene Arnesen Co-authored-by: Øydis Kind Refsum Co-authored-by: Christian Bülow Skovborg --- backend/src/main/kotlin/no/nav/helse/sprik/db/Database.kt | 8 ++++---- nais.yml | 2 -- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/db/Database.kt b/backend/src/main/kotlin/no/nav/helse/sprik/db/Database.kt index 2dff291..e8cd4f6 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/db/Database.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/db/Database.kt @@ -28,8 +28,8 @@ class Database(dbconfig: HikariConfig = dbconfig()) { private fun dbconfig() = HikariConfig().apply { jdbcUrl = DB_URL - username = username - password = password + username = Environment.Database.username + password = Environment.Database.password maximumPoolSize = 1 connectionTimeout = 30.seconds.toJavaDuration().toMillis() initializationFailTimeout = 1.minutes.toJavaDuration().toMillis() @@ -37,8 +37,8 @@ private fun dbconfig() = HikariConfig().apply { private fun migrateconfig() = HikariConfig().apply { jdbcUrl = DB_URL - username = username - password = password + username = Environment.Database.username + password = Environment.Database.password maximumPoolSize = 2 connectionTimeout = 30.seconds.toJavaDuration().toMillis() initializationFailTimeout = 1.minutes.toJavaDuration().toMillis() diff --git a/nais.yml b/nais.yml index 5447b30..a145fdb 100644 --- a/nais.yml +++ b/nais.yml @@ -18,8 +18,6 @@ spec: databases: - name: helse-sprik envVarPrefix: DATABASE - users: - - name: helse-sprik resources: requests: cpu: 100m From d671beda1d1b4956c10c460de66242f6625aef4d Mon Sep 17 00:00:00 2001 From: Sindre Kjelsrud Date: Thu, 13 Jul 2023 10:18:40 +0200 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=94=A7=20Appen=20svarer=20p=C3=A5=20i?= =?UTF-8?q?salive=20og=20isready?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Markus A. R. Johansen Co-authored-by: Amalie Erdal Mansåker Co-authored-by: Helene Arnesen Co-authored-by: Øydis Kind Refsum Co-authored-by: Christian Bülow Skovborg --- .../src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt | 6 ++++++ nais.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt index 6e6d0c1..ea8ae17 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt @@ -28,6 +28,12 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin get("/") { call.respondText("Hello World!") } + get("/isalive"){ + call.respondText("ALIVE") + } + get("/isready"){ + call.respondText("READY") + } post("/test") { val test = call.receive() call.respond(status = HttpStatusCode.Created, message = test) diff --git a/nais.yml b/nais.yml index a145fdb..c5901ec 100644 --- a/nais.yml +++ b/nais.yml @@ -8,6 +8,12 @@ metadata: spec: image: {{ image }} port: 8080 + liveness: + path: isalive + initialDelay: 5 + readyness: + path: isready + initialDelay: 5 replicas: min: 1 max: 2 From a5d0e0d3694d7c5652b2877fa3e3a7c9e209c6c5 Mon Sep 17 00:00:00 2001 From: Sindre Kjelsrud Date: Thu, 13 Jul 2023 10:32:03 +0200 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=94=A7=20Hold=20tr=C3=A5den=20i=20gan?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Markus A. R. Johansen Co-authored-by: Amalie Erdal Mansåker Co-authored-by: Helene Arnesen Co-authored-by: Øydis Kind Refsum Co-authored-by: Christian Bülow Skovborg --- backend/src/main/kotlin/no/nav/helse/sprik/Application.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/Application.kt b/backend/src/main/kotlin/no/nav/helse/sprik/Application.kt index c6f1928..2ff3f15 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/Application.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/Application.kt @@ -13,9 +13,8 @@ fun main() { class Application(private val db: Database) { fun startBlocking() { - runBlocking { - configureRouting().start(wait = false) + configureRouting().start(wait = true) Runtime.getRuntime().addShutdownHook( Thread { db.dataSource.close() From 593473751e284a6106627c8227bcb81a6562bf36 Mon Sep 17 00:00:00 2001 From: Sindre Kjelsrud Date: Thu, 13 Jul 2023 10:42:22 +0200 Subject: [PATCH 5/7] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20readyness=20=3D=20r?= =?UTF-8?q?eadiness?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Markus A. R. Johansen Co-authored-by: Amalie Erdal Mansåker Co-authored-by: Helene Arnesen Co-authored-by: Øydis Kind Refsum Co-authored-by: Christian Bülow Skovborg --- nais.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nais.yml b/nais.yml index c5901ec..ba3bbf6 100644 --- a/nais.yml +++ b/nais.yml @@ -11,7 +11,7 @@ spec: liveness: path: isalive initialDelay: 5 - readyness: + readiness: path: isready initialDelay: 5 replicas: From 89f20836cf7087c1aa499d38106ce6e55954afb5 Mon Sep 17 00:00:00 2001 From: Sindre Kjelsrud Date: Thu, 13 Jul 2023 10:56:08 +0200 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=94=A7=20Setter=20port=20til=208080?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Markus A. R. Johansen Co-authored-by: Amalie Erdal Mansåker Co-authored-by: Helene Arnesen Co-authored-by: Øydis Kind Refsum Co-authored-by: Christian Bülow Skovborg --- backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt index ea8ae17..293c300 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt @@ -43,9 +43,11 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin println(test) call.respond(status = HttpStatusCode.Created, message = test) } - } } + connector { + port = 8080 + } }) From d233d7e28a312671da228499fdc8e31e915bec9d Mon Sep 17 00:00:00 2001 From: Markus Johansen Date: Thu, 13 Jul 2023 12:32:33 +0200 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=94=A7=20Konfigurerte=20gradle.build?= =?UTF-8?q?=20til=20=C3=A5=20hente=20next.js=20bygget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sindre Kjelsrud Co-authored-by: Amalie Mansåker Co-authored-by: Christian Bulow Skovborg --- .../src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt | 8 ++++++++ frontend/next.config.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt index 293c300..eaf420e 100644 --- a/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt +++ b/backend/src/main/kotlin/no/nav/helse/sprik/plugins/Routing.kt @@ -8,6 +8,7 @@ import io.ktor.server.plugins.contentnegotiation.* import io.ktor.serialization.kotlinx.json.* import io.ktor.server.cio.* import io.ktor.server.engine.* +import io.ktor.server.http.content.* import io.ktor.server.plugins.cors.routing.* import io.ktor.server.request.* import no.nav.helse.sprik.Test @@ -25,6 +26,13 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin json() } routing { + singlePageApplication{ + filesPath = "frontend/.next/server/pages/" + defaultPage = "index.html" + ignoreFiles { + it.endsWith(".txt") + } + } get("/") { call.respondText("Hello World!") } diff --git a/frontend/next.config.js b/frontend/next.config.js index 248c251..7b971ca 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -1,7 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - output: 'standalone', + output: 'export', } module.exports = nextConfig