1
0
This commit is contained in:
2020-10-06 15:54:41 +02:00
parent cf09799bc6
commit f0155dea31
10 changed files with 76 additions and 58 deletions
@@ -0,0 +1,25 @@
package starter.modules
import org.http4k.core.then
import org.http4k.filter.ServerFilters
import org.http4k.routing.ResourceLoader
import org.http4k.routing.routes
import org.http4k.routing.static
import org.koin.dsl.bind
import org.koin.dsl.module
import starter.routes.IndexRouteSupplier
import starter.routes.RouteSupplier
import starter.routes.ZipRouteSupplier
import starter.routes.toRouter
val routesModule = module {
single { IndexRouteSupplier(get()) } bind RouteSupplier::class
single { ZipRouteSupplier(get(), get()) } bind RouteSupplier::class
single {
ServerFilters.CatchAll().then(
routes(
static(ResourceLoader.Classpath("/assets")),
getAll<RouteSupplier>().toRouter()
))
}
}