38 lines
728 B
Python
Raw Normal View History

2025-10-03 22:27:30 +02:00
import asyncio
import uvicorn
2025-10-15 20:53:52 +02:00
from dotenv import load_dotenv
2025-10-03 22:27:30 +02:00
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:
2025-10-15 20:53:52 +02:00
load_dotenv()
2025-10-03 22:27:30 +02:00
setup_logging()
asyncio.run(main())
except KeyboardInterrupt:
# Graceful stop triggered by debugger/CTRL-C
pass