Skip to content

Commit

Permalink
Move remaining keys to env extension file
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissearle committed Dec 19, 2024
1 parent 6c2ee46 commit a877672
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/no/java/conf/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ fun Application.module() {
val searchClient = searchClient(environment.searchClientConfig())
val searchService = searchService(environment.searchServiceConfig(searchClient))

val sleepingPillService = sleepingPillService(httpClient(), environment.endpointConfig("javazone.sleepingpill"))
val localFileService = localFileService(environment.localFileConfig("javazone.localfile"))
val sleepingPillService = sleepingPillService(httpClient(), environment.endpointConfig())
val localFileService = localFileService(environment.localFileConfig())

configureSerialization()
configureMonitoring()
Expand Down
8 changes: 4 additions & 4 deletions src/main/kotlin/no/java/conf/EnvironmentExtensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ fun ApplicationEnvironment.searchServiceConfig(searchClient: SearchClient) =
skipIndex = bool("elastic.skipindex")
)

fun ApplicationEnvironment.endpointConfig(key: String) =
config.configList(key).map {
fun ApplicationEnvironment.endpointConfig() =
config.configList("javazone.sleepingpill").map {
EndpointConfig(it.int("year"), it.str("endpoint"))
}

fun ApplicationEnvironment.localFileConfig(key: String) =
config.configList(key).map {
fun ApplicationEnvironment.localFileConfig() =
config.configList("javazone.localfile").map {
LocalFileConfig(it.int("year"), it.str("LocalFileConfig"))
}

0 comments on commit a877672

Please sign in to comment.