Panel serve redirect from root to one of served apps

Hello,

I’m running a couple of apps using panel serve app1.py app2.py (panel 0.9.7).
Is there a way to make a redirection from http://localhost:5006/ to http://localhost:5006/app1? By default http://localhost:5006/ shows the panel screen in which I can select whether I want to go to app1 or app2. Since app1 is my main application, I would like user to get to it directly.

Regards,
Rafał

1 Like

Using panel.serve inside the code and running the file with python name_of_file.py you can control things like the urls.

The below is how I use it at awesome-panel.org

You can then serve one of the apps at "".

APP_ROUTES = {
    "": app1.view, "app2": app2.view

}
1 Like

I am using configurable-http-proxy https://github.com/jupyterhub/configurable-http-proxy for front ending a number of app’s running with sub urls routing to apps running on multiple ports on the same machine.
The apps all use relative paths so this works except for /static which according to this bokeh docs needs to be served from the static directory of the server , in this case panel serve
Where is that directory ?

2 Likes

I think I hacked it by serving a dummy app using panel serve and forwarding the route “/static” to that panel app serve. Not ideal but it seems the /static is common to all of the other panel apps and so it kinda works. :sweat_smile:

2 Likes