"""Offline local demo: python3 demo.py, then http://localhost:8765"""
from http.server import ThreadingHTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
import os
os.chdir(Path(__file__).parent / 'web')
class Handler(SimpleHTTPRequestHandler):
    def do_GET(self):
        if self.path.split('?')[0].endswith('.php'):
            self.send_error(404)
            return
        super().do_GET()
if __name__ == '__main__':
    print('Pomodoro Lecha: http://localhost:8765', flush=True)
    ThreadingHTTPServer(('127.0.0.1', 8765), Handler).serve_forever()
