Merge branch 'main' into bildeopplastning-komponent
This commit is contained in:
commit
25069ecb19
5 changed files with 29 additions and 10 deletions
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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,9 +26,22 @@ 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!")
|
||||
}
|
||||
get("/isalive"){
|
||||
call.respondText("ALIVE")
|
||||
}
|
||||
get("/isready"){
|
||||
call.respondText("READY")
|
||||
}
|
||||
post("/test") {
|
||||
val test = call.receive<Test>()
|
||||
call.respond(status = HttpStatusCode.Created, message = test)
|
||||
|
@ -37,9 +51,11 @@ fun configureRouting(): ApplicationEngine = embeddedServer(CIO, applicationEngin
|
|||
println(test)
|
||||
call.respond(status = HttpStatusCode.Created, message = test)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
connector {
|
||||
port = 8080
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: true,
|
||||
output: 'standalone',
|
||||
output: 'export',
|
||||
}
|
||||
|
||||
module.exports = nextConfig
|
||||
|
|
8
nais.yml
8
nais.yml
|
@ -8,6 +8,12 @@ metadata:
|
|||
spec:
|
||||
image: {{ image }}
|
||||
port: 8080
|
||||
liveness:
|
||||
path: isalive
|
||||
initialDelay: 5
|
||||
readiness:
|
||||
path: isready
|
||||
initialDelay: 5
|
||||
replicas:
|
||||
min: 1
|
||||
max: 2
|
||||
|
@ -18,8 +24,6 @@ spec:
|
|||
databases:
|
||||
- name: helse-sprik
|
||||
envVarPrefix: DATABASE
|
||||
users:
|
||||
- name: helse-sprik
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
|
|
Reference in a new issue