forked from mtusi2026/mtusi2026lab3
18 lines
564 B
Python
18 lines
564 B
Python
import logging
|
|
import os
|
|
|
|
import uvicorn
|
|
|
|
|
|
def main():
|
|
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
|
|
logging.getLogger("psycopg.pool").setLevel(logging.CRITICAL)
|
|
logging.info("Starting lab3 environment=%s with shared PostgreSQL and Redis", os.getenv("APP_ENV", "lab"))
|
|
uvicorn.run("app.api:app", host=os.getenv("APP_HOST", "0.0.0.0"),
|
|
port=int(os.getenv("APP_PORT", "8080")), workers=1,
|
|
access_log=False, timeout_graceful_shutdown=5)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|