Files
tykkaa.fi/server.py
Jukka Lampikoski 5d02a682b0 Switch dev server from Python to PHP built-in server
The Python SimpleHTTPRequestHandler served api.php as a static file
instead of executing it, breaking registration, login and all API calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 11:50:31 +02:00

21 lines
508 B
Python

#!/usr/bin/env python3
"""
tykkää.fi dev server — launches PHP built-in server
so that api.php, upload.php and static files all work.
"""
import os, subprocess, sys
from pathlib import Path
PORT = 3000
if __name__ == '__main__':
os.chdir(Path(__file__).parent)
print(f'tykkää.fi running at http://localhost:{PORT}')
try:
subprocess.run(
['php', '-S', f'localhost:{PORT}'],
check=True,
)
except KeyboardInterrupt:
print('\nSammutettu.')