#!/usr/bin/env python3
# serves web_dashboard.html at / on localhost:8090
import http.server
import os

PORT = 8090
DASHBOARD = "web_dashboard.html"


class Handler(http.server.SimpleHTTPRequestHandler):
    def do_GET(self):
        if self.path in ("/", "/index.html"):
            self.path = "/" + DASHBOARD
        return super().do_GET()

    def log_message(self, *args):
        pass  # quiet


if __name__ == "__main__":
    os.chdir(os.path.dirname(os.path.abspath(__file__)))
    http.server.HTTPServer(("127.0.0.1", PORT), Handler).serve_forever()
