2025-10-15 20:53:52 +02:00

38 lines
728 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import asyncio
import uvicorn
from dotenv import load_dotenv
from app import create_app
from logs import setup_logging
async def main():
app = create_app()
config = uvicorn.Config(
app,
host="127.0.0.1",
port=8000,
reload=False,
loop="asyncio",
log_config=None,
)
server = uvicorn.Server(config)
try:
await server.serve()
except KeyboardInterrupt:
# Swallow debuggers SIGINT
pass
# Pycharm-Debuggable Uvicorn Server
if __name__ == "__main__":
try:
load_dotenv()
setup_logging()
asyncio.run(main())
except KeyboardInterrupt:
# Graceful stop triggered by debugger/CTRL-C
pass