You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the API paths have to be defined at import-time, because FPS registers all the plugins through entry points and checks for path conflicts, etc. But we might want API paths to be configurable at run-time.
Proposed Solution
Could it be possible to defer the registration of routers, so that they have been configured before they are registered?
Maybe plugins could have initialize() and get_routers() callback hooks, where initialize passes configuration to a plugin before get_routers gets its routers back.
Additional context
For instance, Voila allows to configure the path to statically served directories, but if we want to implement that using FPS, we cannot use mounting points, we need to hack by defining an endpoint with a generic path, and implement the dynamic behavior inside the handler.
The text was updated successfully, but these errors were encountered:
Problem
Currently the API paths have to be defined at import-time, because FPS registers all the plugins through entry points and checks for path conflicts, etc. But we might want API paths to be configurable at run-time.
Proposed Solution
Could it be possible to defer the registration of routers, so that they have been configured before they are registered?
Maybe plugins could have
initialize()
andget_routers()
callback hooks, whereinitialize
passes configuration to a plugin beforeget_routers
gets its routers back.Additional context
For instance, Voila allows to configure the path to statically served directories, but if we want to implement that using FPS, we cannot use mounting points, we need to hack by defining an endpoint with a generic path, and implement the dynamic behavior inside the handler.
The text was updated successfully, but these errors were encountered: