Move ConfigLoader
This commit is contained in:
parent
8b8dbd6fe5
commit
0260bea951
@ -2,6 +2,7 @@ package be.simplenotes.app
|
||||
|
||||
import be.simplenotes.app.extensions.addShutdownHook
|
||||
import be.simplenotes.app.modules.*
|
||||
import be.simplenotes.config.configModule
|
||||
import be.simplenotes.domain.domainModule
|
||||
import be.simplenotes.persistance.migrationModule
|
||||
import be.simplenotes.persistance.persistanceModule
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
package be.simplenotes.app.modules
|
||||
|
||||
import be.simplenotes.app.Config
|
||||
import be.simplenotes.app.utils.StaticFileResolver
|
||||
import org.koin.core.qualifier.named
|
||||
import org.koin.dsl.module
|
||||
|
||||
val configModule = module {
|
||||
single { Config() }
|
||||
single { get<Config>().dataSourceConfig }
|
||||
single { get<Config>().jwtConfig }
|
||||
single { get<Config>().serverConfig }
|
||||
}
|
||||
@ -11,5 +11,11 @@
|
||||
|
||||
<artifactId>simplenotes-config</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.koin</groupId>
|
||||
<artifactId>koin-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
package be.simplenotes.app
|
||||
package be.simplenotes.config
|
||||
|
||||
import be.simplenotes.config.DataSourceConfig
|
||||
import be.simplenotes.config.JwtConfig
|
||||
import be.simplenotes.config.ServerConfig
|
||||
import java.util.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class Config {
|
||||
class ConfigLoader {
|
||||
//region Config loading
|
||||
private val properties: Properties = javaClass
|
||||
.getResource("/application.properties")
|
||||
@ -0,0 +1,10 @@
|
||||
package be.simplenotes.config
|
||||
|
||||
import org.koin.dsl.module
|
||||
|
||||
val configModule = module {
|
||||
single { ConfigLoader() }
|
||||
single { get<ConfigLoader>().dataSourceConfig }
|
||||
single { get<ConfigLoader>().jwtConfig }
|
||||
single { get<ConfigLoader>().serverConfig }
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user