Skip to content
Snippets Groups Projects
Commit 50942008 authored by Gavin M. Roy's avatar Gavin M. Roy
Browse files

Move example

parent a06f4186
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -8,14 +8,6 @@ class ExampleHandler(web.RequestHandler):
def initialize(self):
self.session = queries.TornadoSession()
 
@gen.coroutine
def prepare(self):
try:
yield self.session.validate()
except queries.OperationalError as error:
logging.error('Error connecting to the database: %s', error)
raise web.HTTPError(503)
@gen.coroutine
def get(self):
try:
Loading
Loading
@@ -29,10 +21,10 @@ class ExampleHandler(web.RequestHandler):
 
 
application = web.Application([
(r"/", ExampleHandler),
(r'/', ExampleHandler),
])
 
if __name__ == "__main__":
if __name__ == '__main__':
logging.basicConfig(level=logging.INFO)
application.listen(8888)
ioloop.IOLoop.instance().start()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment