[Python] How to define a base URL for a Shiny application?

Discussão em 'Python' iniciado por Stack, Setembro 25, 2024.

  1. Stack

    Stack Membro Participativo

    I deployed a python Shiny application in Kubernetes. The Kubernetes Ingress routes the requests to the corresponding Deployment in Kubernetes with a base URL path. This means that when I access http://example.org/baseurl in my browser it routes the request to the specific Kubernetes Deployment where the Shiny app is running. The problem is that the Shiny app responds with 404 because it doesn't recognize the URL /baseurl

    I tried to modify the Kubernetes Ingress in order to remove the /baseurl to requests that are routed to the Deployment. This doesn't work because shiny loads several javascript and css files with the wrong URL. For example: http://example.org/lib/shiny-data-frame-output-0.10.2/data-frame.js Instead of: http://example.org/baseurl/lib/shiny-data-frame-output-0.10.2/data-frame.js

    My Kubernetes Deployment runs the shiny app with the following command: command:

    ["uvicorn", "shiny_demo.shiny.run:app", "--host", "0.0.0.0", "--port", "5000"]

    Continue reading...

Compartilhe esta Página