From d233d7e28a312671da228499fdc8e31e915bec9d Mon Sep 17 00:00:00 2001 From: Markus Johansen Date: Thu, 13 Jul 2023 12:32:33 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Konfigurerte=20gradle.build=20ti?= =?UTF-8?q?l=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