How to add a status page when panel serve

Something like

When I do: panel serve

import panel as pn

pn.pane.Markdown("it is running").servable()

I get a 200, but also a lot of extra stuff:

<!DOCTYPE html>
<html lang="en">
      <meta charset="utf-8">
      <title>Panel Application</title>
        <link rel="stylesheet" href="static/extensions/panel/css/alerts.css" type="text/css" />
        <link rel="stylesheet" href="static/extensions/panel/css/card.css" type="text/css" />
        <link rel="stylesheet" href="static/extensions/panel/css/dataframe.css" type="text/css" />
        <link rel="stylesheet" href="static/extensions/panel/css/json.css" type="text/css" />
        <link rel="stylesheet" href="static/extensions/panel/css/loading.css" type="text/css" />
        <link rel="stylesheet" href="static/extensions/panel/css/markdown.css" type="text/css" />
        <link rel="stylesheet" href="static/extensions/panel/css/widgets.css" type="text/css" />
1 Like

Hi @ahuang11

You can do this in minimum 4 ways.

  • a custom template just returning json
  • a rest api (yes, panel supports this)
  • a static page just returning json
  • a custom tornado handler

For someone with no web dev experience, all dependent on panel, can you share an example with a static page / rest api (those sound the simplest)?

to be fair, id assume that panel is not the right tool for a simple api endpoint, and that there are better options for that :slight_smile:

I guess so, but I already had an app, but with status checks, it used up too much resources, so I added an endpoint with
panel serve main_app/ main_app/

1 Like