risotto/script/risotto-server

17 lines
397 B
Plaintext
Raw Normal View History

2020-03-25 14:35:05 +01:00
#!/usr/bin/env python3
2020-11-14 19:01:28 +01:00
from sdnotify import SystemdNotifier
2019-12-02 10:29:40 +01:00
from asyncio import get_event_loop
2019-11-28 14:50:53 +01:00
from risotto import get_app
2020-01-30 16:22:06 +01:00
2019-11-28 14:50:53 +01:00
if __name__ == '__main__':
2020-11-14 19:01:28 +01:00
notifier = SystemdNotifier()
2019-12-02 10:29:40 +01:00
loop = get_event_loop()
loop.run_until_complete(get_app(loop))
2020-11-14 19:01:28 +01:00
print('HTTP server ready')
notifier.notify("READY=1")
2019-12-02 10:29:40 +01:00
try:
loop.run_forever()
except KeyboardInterrupt:
pass