#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ ================================================================================ HFChart — plateforme de référence des charts haute fréquence Hôte statique minimal (stdlib uniquement). Les données des graphs proviennent de l'API HF Market Data : https://www.hfmarketdata.io (interrogée directement par le navigateur) Author : Simon-Pierre Boucher Contact : contact@spboucher.ai ================================================================================ python3 server.py [port] # défaut: 8787 """ import os import sys from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from urllib.parse import urlparse ROOT = os.path.dirname(os.path.abspath(__file__)) WEB = os.path.join(ROOT, "web") MIME = { ".html": "text/html; charset=utf-8", ".js": "application/javascript; charset=utf-8", ".css": "text/css; charset=utf-8", ".json": "application/json; charset=utf-8", ".svg": "image/svg+xml", ".png": "image/png", ".ico": "image/x-icon", ".webmanifest": "application/manifest+json", } # /embed.js = moteur complet concaténé (transforms + indicateurs + renderers + # engine + bootstrapper d'embed) — un seul