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

Allow apps to create their own rest APIs #1764

Open
AHarouni opened this issue Oct 24, 2024 · 0 comments
Open

Allow apps to create their own rest APIs #1764

AHarouni opened this issue Oct 24, 2024 · 0 comments

Comments

@AHarouni
Copy link
Contributor

AHarouni commented Oct 24, 2024

Is your feature request related to a problem? Please describe.
There are ways for an app to override and custom most of the classes. However, I can't find a way to overwrite or extend the rest APIs. I do need to create my own rest APIs and customize it

Describe the solution you'd like
Have a way to get to get the restAPIinstance in the same way I can get the datastore as

    instance: MONAILabelApp = app_instance()
    datastore= instance.datastore()

It would be great if there is a function that the app can override as

_add_endpoint(self,routing_app):
# add code here to return or include new new restapis
rounting_app.include_router(....)

Describe alternatives you've considered
I had to manually hack the the python packages as /usr/local/lib/python3.8/dist-packages/monailabel/app.py
and add a global variable as

global global_routing_app 
global_routing_app = app

which I then define in my app as

global global_routing_app 
global_routing_app .include_router(xnat.router, prefix=settings.MONAI_LABEL_API_STR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant