mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-05 05:06:40 +02:00
Fix tile server.
This commit is contained in:
parent
970046aa86
commit
c4005655ef
1 changed files with 6 additions and 4 deletions
|
@ -20,12 +20,13 @@ class Handler(SimpleHTTPRequestHandler):
|
||||||
HTTP request handler that process sloppy map tile requests.
|
HTTP request handler that process sloppy map tile requests.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
cache: Path = Path("cache")
|
||||||
|
update_cache: bool = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self, request: bytes, client_address: tuple[str, int], server
|
self, request: bytes, client_address: tuple[str, int], server
|
||||||
) -> None:
|
) -> None:
|
||||||
super().__init__(request, client_address, server)
|
super().__init__(request, client_address, server)
|
||||||
self.cache: Path = Path("cache")
|
|
||||||
self.update_cache: bool = False
|
|
||||||
|
|
||||||
def do_GET(self) -> None:
|
def do_GET(self) -> None:
|
||||||
"""Serve a GET request."""
|
"""Serve a GET request."""
|
||||||
|
@ -64,8 +65,9 @@ def ui(options) -> None:
|
||||||
server: Optional[HTTPServer] = None
|
server: Optional[HTTPServer] = None
|
||||||
try:
|
try:
|
||||||
port: int = 8080
|
port: int = 8080
|
||||||
server: HTTPServer = HTTPServer(("", port), Handler)
|
handler = Handler
|
||||||
server.cache_path = Path(options.cache)
|
handler.cache = Path(options.cache)
|
||||||
|
server: HTTPServer = HTTPServer(("", port), handler)
|
||||||
server.serve_forever()
|
server.serve_forever()
|
||||||
logging.info(f"Server started on port {port}.")
|
logging.info(f"Server started on port {port}.")
|
||||||
finally:
|
finally:
|
||||||
|
|
Loading…
Add table
Reference in a new issue