#!/usr/bin/env python3
"""Minimal HTTP server for the i4Fuel pipeline dashboard."""
import http.server
import os
from pathlib import Path

PORT = 3001
DIRECTORY = Path(__file__).resolve().parent


class Handler(http.server.SimpleHTTPRequestHandler):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, directory=str(DIRECTORY), **kwargs)

    def log_message(self, fmt, *args):
        pass  # suppress request logs


if __name__ == "__main__":
    os.chdir(DIRECTORY)
    with http.server.HTTPServer(("127.0.0.1", PORT), Handler) as httpd:
        httpd.serve_forever()
