#!/usr/bin/env python3
# Minimal static server for poc.html.
# http://localhost is a secure context, so showSaveFilePicker() is available
# without HTTPS.
import http.server
import socketserver
import os

PORT = 8080
os.chdir(os.path.dirname(os.path.abspath(__file__)))

class H(http.server.SimpleHTTPRequestHandler):
    def end_headers(self):
        self.send_header('Cache-Control', 'no-store')
        super().end_headers()

with socketserver.TCPServer(('127.0.0.1', PORT), H) as httpd:
    httpd.allow_reuse_address = True
    print(f'Serving POC on http://localhost:{PORT}/poc.html')
    httpd.serve_forever()
