Skip to content

Commit

Permalink
Migrate DI
Browse files Browse the repository at this point in the history
  • Loading branch information
ILIYANGERMANOV committed Nov 25, 2024
1 parent 17988b0 commit 2d7af2a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/src/main/kotlin/ivy/learn/di/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package ivy.learn.di

import ivy.di.Di
import ivy.di.Di.register
import ivy.di.Di.singleton
import ivy.di.autowire.autoWire
import ivy.di.autowire.autoWireSingleton
import ivy.learn.Environment
import ivy.learn.EnvironmentImpl
import ivy.learn.LearnServer
Expand All @@ -11,9 +12,7 @@ import ivy.learn.ServerConfigurationProvider
class AppModule(private val devMode: Boolean) : Di.Module {
override fun init() = Di.appScope {
register<Environment> { EnvironmentImpl() }
register { ServerConfigurationProvider(Di.get()) }
singleton {
LearnServer(Di.get(), Di.get())
}
autoWire(::ServerConfigurationProvider)
autoWireSingleton(::LearnServer)
}
}

0 comments on commit 2d7af2a

Please sign in to comment.