mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Start of web interface
This commit is contained in:
@@ -20,6 +20,8 @@ class WebServer:
|
||||
|
||||
# Set up routing
|
||||
bottle.get("/api/spots")(self.serve_api_spots)
|
||||
bottle.get("/")(self.serve_index)
|
||||
bottle.get("/<filepath:path>")(self.serve_static_file)
|
||||
|
||||
# Start the web server
|
||||
def start(self):
|
||||
@@ -36,8 +38,16 @@ class WebServer:
|
||||
response.content_type = 'application/json'
|
||||
return spots_json
|
||||
|
||||
# Serve the home page. This would be accessible as /index.html but we need this workaround to make it available as /
|
||||
def serve_index(self):
|
||||
return bottle.static_file("index.html", root="webassets")
|
||||
|
||||
# Todo spot API arguments e.g. "since" based on received_time of spots, sources, sigs, dx cont, dxcc, de cont, band, mode, filter out qrt, filter pre-qsy
|
||||
# Serve general static files from "webassets" directory
|
||||
def serve_static_file(self, filepath):
|
||||
return bottle.static_file(filepath, root="webassets")
|
||||
|
||||
|
||||
# Todo spot API arguments e.g. "since" based on received_time of spots, sources, sigs, dx cont, dxcc, de cont, band, mode, filter out qrt, filter pre-qsy, sort order, list of fields
|
||||
# Todo serve status API
|
||||
# Todo serve apidocs
|
||||
# Todo serve website
|
||||
|
||||
Reference in New Issue
Block a user