Skip to content

Commit

Permalink
feat: koin and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasDev committed Jan 3, 2025
1 parent 5725f15 commit 6f022b5
Show file tree
Hide file tree
Showing 82 changed files with 795 additions and 965 deletions.
10 changes: 7 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ val googlePostgresVersion = "1.21.0"
val googleOauthVersion = "1.36.0"
val ktfmtVersion = "0.44"
val kafkaVersion = "3.9.0"

val koin_version="4.0.1"
val kotestKoin_version = "1.3.0"
///Due to vulnerabilities
val nettycommonVersion = "4.1.115.Final"
val snappyJavaVersion = "1.1.10.7"
Expand Down Expand Up @@ -67,7 +68,7 @@ repositories {
implementation("io.ktor:ktor-server-status-pages:$ktorVersion")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-apache:$ktorVersion")

implementation("io.ktor:ktor-client-content-negotiation:$ktorVersion")
implementation("io.ktor:ktor-serialization-jackson:$ktorVersion")

Expand All @@ -91,9 +92,12 @@ repositories {
implementation("org.postgresql:postgresql:$postgresVersion")
implementation("com.google.cloud.sql:postgres-socket-factory:$googlePostgresVersion")
implementation("com.google.oauth-client:google-oauth-client:$googleOauthVersion")
implementation("io.insert-koin:koin-ktor:$koin_version")
implementation("io.insert-koin:koin-logger-slf4j:$koin_version")
implementation("io.kotest.extensions:kotest-extensions-koin:$kotestKoin_version")

swaggerUI("org.webjars:swagger-ui:$swaggerUiVersion")

testImplementation("io.insert-koin:koin-test:$koin_version")
testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlinVersion")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
Expand Down
27 changes: 27 additions & 0 deletions src/main/kotlin/no/nav/syfo/Application.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package no.nav.syfo

import io.ktor.server.application.Application
import io.ktor.server.engine.embeddedServer
import io.ktor.server.netty.Netty
import no.nav.syfo.plugins.configureContentNegotiation
import no.nav.syfo.plugins.configureDependencies
import no.nav.syfo.plugins.configureLifecycleHooks
import no.nav.syfo.plugins.configureNaisResources
import no.nav.syfo.plugins.configurePrometheus
import no.nav.syfo.plugins.configureRouting
import no.nav.syfo.plugins.setupAuth
import org.koin.ktor.ext.get

fun main() {
embeddedServer(Netty, port = 8080, module = Application::module).start(true)
}

fun Application.module() {
configurePrometheus()
configureContentNegotiation()
setupAuth(get())
configureNaisResources(get())
configureLifecycleHooks()
configureDependencies()
configureRouting()
}
154 changes: 0 additions & 154 deletions src/main/kotlin/no/nav/syfo/Bootstrap.kt

This file was deleted.

93 changes: 0 additions & 93 deletions src/main/kotlin/no/nav/syfo/application/ApplicationEngine.kt

This file was deleted.

28 changes: 0 additions & 28 deletions src/main/kotlin/no/nav/syfo/application/ApplicationServer.kt

This file was deleted.

47 changes: 0 additions & 47 deletions src/main/kotlin/no/nav/syfo/application/api/NaisRest.kt

This file was deleted.

Loading

0 comments on commit 6f022b5

Please sign in to comment.