mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 09:14:30 +00:00
18 lines
487 B
Python
18 lines
487 B
Python
import json
|
|
|
|
import tornado
|
|
|
|
from core.utils import serialize_everything
|
|
|
|
|
|
# API request handler for /api/v1/status
|
|
class APIStatusHandler(tornado.web.RequestHandler):
|
|
def initialize(self, status_data):
|
|
self.status_data = status_data
|
|
|
|
def get(self):
|
|
self.write(json.dumps(self.status_data, default=serialize_everything))
|
|
self.set_status(200)
|
|
self.set_header("Cache-Control", "no-store")
|
|
self.set_header("Content-Type", "application/json")
|