2021-11-04 17:13:24 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import argparse
|
|
|
|
import asyncio
|
2021-11-17 18:56:40 +00:00
|
|
|
import logging
|
2021-11-04 17:13:24 +00:00
|
|
|
|
|
|
|
from obs.api.app import app
|
|
|
|
from obs.api.db import connect_db
|
|
|
|
|
|
|
|
|
|
|
|
def main():
|
2021-11-16 20:59:37 +00:00
|
|
|
debug = app.config.DEBUG
|
2021-11-17 18:56:40 +00:00
|
|
|
|
|
|
|
logging.basicConfig(
|
|
|
|
level=logging.DEBUG if debug else logging.INFO,
|
|
|
|
format="%(levelname)s: %(message)s",
|
|
|
|
)
|
|
|
|
|
2021-11-16 20:59:37 +00:00
|
|
|
app.run(
|
|
|
|
host=app.config.HOST,
|
|
|
|
port=app.config.PORT,
|
|
|
|
debug=debug,
|
|
|
|
auto_reload=app.config.get("AUTO_RELOAD", debug),
|
|
|
|
)
|
2021-11-04 17:13:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|