INNER CODE UNIT · Python
_serve_html
yohey-w/multi-agent-shogun · scripts/dashboard-viewer.py:239
def _serve_html(self):
body = HTML_TEMPLATE.encode("utf-8")
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
def _serve_markdown(self):
try:
text = self.dashboard_path.read_text(encoding="utf-8")
except FileNotFoundError:
self.send_error(404, "dashboard.md not found")
return
body = text.encode("utf-8")
self.send_response(200)
self.send_header("Content-Type", "text/plain; charset=utf-8")
self.send_header("Cache-Control", "no-cache")