Use a single config file

This commit is contained in:
2020-06-30 16:23:06 +02:00
parent a1e7c8ba98
commit 0993d93ccc
4 changed files with 23 additions and 48 deletions
+1 -4
View File
@@ -16,10 +16,7 @@ import javax.sql.DataSource
* [Kodein] controller module containing the app configuration
*/
val configurationModule = Kodein.Module(name = "Configuration") {
bind() from singleton {
val configFile by this.kodein.instance<String>(tag = "config file")
ConfigLoader().loadConfigOrThrow<Config>(configFile)
}
bind() from singleton { ConfigLoader().loadConfigOrThrow<Config>("/application.yaml") }
bind<SimpleJWT>(tag = "auth") with singleton { configureAuthJwt(this.kodein) }
bind<SimpleJWT>(tag = "refresh") with singleton { configureRefreshJwt(this.kodein) }
bind<DataSource>() with singleton { configureDatasource(this.kodein) }