Created
July 25, 2021 11:58
-
-
Save markchristopherng/987c06893689b063d778eb31d72924e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun Application.module() { | |
val jsonParser = Json { | |
ignoreUnknownKeys = true | |
isLenient = true | |
} | |
install(ContentNegotiation) { | |
json(jsonParser) | |
} | |
val client = HttpClient(Apache) { | |
install(JsonFeature) { | |
serializer = KotlinxSerializer(jsonParser) | |
} | |
} | |
install(Koin) { | |
slf4jLogger() | |
modules(org.koin.dsl.module { single { client }; single { jsonParser } }, greetingModule) | |
} | |
registerGreetingRoutes() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment