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>
21 lines
508 B
Python
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.')
|