Basically wrote the whole thing.

This commit is contained in:
Aodhan
2025-06-25 04:21:13 +01:00
parent 1ff4a6f6d7
commit c5391a957d
216 changed files with 168676 additions and 1303 deletions

28
server.py Normal file
View File

@@ -0,0 +1,28 @@
"""Minimal entry-point for the SWIPER web-server.
Usage: python server.py
"""
from http.server import HTTPServer
from config import DB_PATH, IMAGE_DIR, PORT
from database import init_db, sync_image_database
from handler import ImageSwipeHandler
def run(port: int = PORT) -> None: # noqa: D401
"""Start the HTTP server on the given port."""
init_db()
sync_image_database()
server_address = ("", port)
httpd = HTTPServer(server_address, ImageSwipeHandler)
print(f"Starting server on port {port}")
print(f"Image directory: {IMAGE_DIR}")
print(f"Database: {DB_PATH}")
httpd.serve_forever()
if __name__ == "__main__":
run()