Clone in a terminal:
server.py
examples/threads/ - Remove threads with shared memory commit 9c53342
#!/usr/bin/env python3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
from pathlib import Path
import sys

PKG_DIR = Path(__file__).resolve().parent / 'pkg'

class RequestHandler(SimpleHTTPRequestHandler):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, directory=str(PKG_DIR), **kwargs)

    def end_headers(self):
        self.send_header('Cross-Origin-Opener-Policy', 'same-origin')
        self.send_header('Cross-Origin-Embedder-Policy', 'require-corp')
        SimpleHTTPRequestHandler.end_headers(self)

if __name__ == '__main__':
    port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000
    print(f"Serving {PKG_DIR} at http://localhost:{port}/")
    test(RequestHandler, HTTPServer, port=port, bind='127.0.0.1')

File history (2 commits)

321ec6b Johan Mattsson - johan.mattsson.m@gmail.com
Remove threads with shared memory
Remove threads with shared memory
2145271 Johan Mattsson - johan.mattsson.m@gmail.com
Remove thread pool and provide a single function for spawning new threads
Remove thread pool and provide a single function for spawning new threads

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112