bitvend/bitvend-run.py

29 lines
513 B
Python
Raw Normal View History

#!/usr/bin/env python3
2017-01-13 14:08:45 +00:00
import logging
2017-01-14 01:04:41 +00:00
2023-07-14 21:33:45 +00:00
logging.basicConfig(level=logging.DEBUG) # noqa
2017-01-14 01:04:41 +00:00
2017-04-04 21:56:42 +00:00
import threading
from bitvend import create_app, dev, proc, db
2017-01-13 14:08:45 +00:00
2017-04-04 21:56:42 +00:00
if __name__ == "__main__":
from prometheus_client import start_http_server
2023-07-14 21:33:45 +00:00
2017-04-04 21:56:42 +00:00
start_http_server(8000)
2017-04-04 21:56:42 +00:00
app = create_app()
2017-01-13 16:08:40 +00:00
2017-01-14 01:04:41 +00:00
with app.app_context():
db.create_all()
2023-07-14 21:33:45 +00:00
threading.Thread(
target=app.run,
kwargs={
"host": "0.0.0.0",
},
daemon=True,
).start()
# proc.start()
2017-01-13 22:42:10 +00:00
dev.run()