26 lines
733 B
Kotlin
26 lines
733 B
Kotlin
package dev.inmo.postssystem.core.ktor.server.content
|
|
|
|
import dev.inmo.postssystem.core.content.api.ContentRepo
|
|
import dev.inmo.postssystem.core.ktor.contentRootRoute
|
|
import dev.inmo.micro_utils.ktor.server.configurators.ApplicationRoutingConfigurator
|
|
import io.ktor.routing.Route
|
|
import io.ktor.routing.route
|
|
|
|
fun Route.configureContentRepoRoutes(
|
|
proxyTo: ContentRepo
|
|
) {
|
|
route(
|
|
contentRootRoute
|
|
) {
|
|
configureReadContentRepoRoutes(proxyTo)
|
|
configureWriteContentRepoRoutes(proxyTo)
|
|
}
|
|
}
|
|
|
|
class ContentRepoRoutingConfigurator(
|
|
private val proxyTo: ContentRepo
|
|
) : ApplicationRoutingConfigurator.Element {
|
|
override fun Route.invoke() {
|
|
configureContentRepoRoutes(proxyTo)
|
|
}
|
|
} |