sprockets-status/examples/app.py
Dave Shawley 0f63e9675b Implement primitive StatusHandler.
This version simply returns a JSON object based on the values passed
into the initialize method.
2017-02-19 21:11:06 -05:00

24 lines
494 B
Python

from tornado import ioloop, web
import sprockets_status.handlers
name = 'my-application'
version = '1.2.3'
def make_app(**settings):
return web.Application([
web.url('/status', sprockets_status.handlers.StatusHandler,
{'name': name, 'version': version}),
], **settings)
if __name__ == '__main__':
app = make_app()
iol = ioloop.IOLoop.current()
try:
app.listen(8888)
iol.start()
except KeyboardInterrupt:
iol.stop()