Emily
05/04/2025, 9:33 AMJames Richardson
05/04/2025, 12:40 PMEmily
05/04/2025, 4:14 PMJames Richardson
05/04/2025, 7:51 PMEmily
05/04/2025, 9:13 PMroutes("/myroutes" bind it)
before delegating to it
fun <T: Plugin> pluginHandler(manager: PluginManager<T>): HttpHandler {
val plugin = Path.of("plugin")
return handler@{ req: Request ->
val pluginRouteMap = manager.loadedPluginRouteMap
val plugin = plugin(req)
val route = pluginRouteMap[plugin]
if (route == null) {
return@handler Response(NOT_ACCEPTABLE)
}
routes("/plugins" bind route)(req)
}
}