mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-02-04 09:14:30 +00:00
Split up some code for sanity #3
This commit is contained in:
17
server/handlers/api/status.py
Normal file
17
server/handlers/api/status.py
Normal file
@@ -0,0 +1,17 @@
|
||||
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")
|
||||
Reference in New Issue
Block a user