31 lines
561 B
Python
31 lines
561 B
Python
"""Run the messenger HTTP server."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
_SRC = Path(__file__).resolve().parents[1]
|
|
if str(_SRC) not in sys.path:
|
|
sys.path.insert(0, str(_SRC))
|
|
|
|
import uvicorn
|
|
|
|
from messenger import config
|
|
|
|
|
|
def main() -> None:
|
|
uvicorn.run(
|
|
"messenger.app:app",
|
|
host=config.app_host(),
|
|
port=config.app_port(),
|
|
log_level="info",
|
|
access_log=False,
|
|
timeout_keep_alive=5,
|
|
timeout_graceful_shutdown=8,
|
|
)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|