mirror of
https://github.com/sprockets/sprockets-status.git
synced 2024-11-25 03:00:19 +00:00
0f63e9675b
This version simply returns a JSON object based on the values passed into the initialize method.
24 lines
494 B
Python
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()
|