Commit 9adf53a9 authored by Markus Mößler's avatar Markus Mößler
Browse files

added simple api handler to send simple message to frontend

parent 56b1e9af
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -66,6 +66,7 @@ class Application(tornado.web.Application):
            (r"/auth/create", AuthCreateHandler),
            (r"/auth/login", AuthLoginHandler),
            (r"/auth/logout", AuthLogoutHandler),
            (r"/api/message", APIHandler),
        ]
        settings = dict(
            blog_title="Tornado Blog",
@@ -296,6 +297,11 @@ class EntryModule(tornado.web.UIModule):
        return self.render_string("modules/entry.html", entry=entry)


class APIHandler(tornado.web.RequestHandler):
    def get(self):
        self.write({"message": "Hello from Tornado Backend!"})


async def main():
    tornado.options.parse_command_line()