Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run-time plugin router definition #54

Open
davidbrochart opened this issue Nov 7, 2021 · 0 comments
Open

Run-time plugin router definition #54

davidbrochart opened this issue Nov 7, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@davidbrochart
Copy link
Contributor

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() 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.

@davidbrochart davidbrochart added the enhancement New feature or request label Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant