This repository has been archived on 2025-09-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Eucalyptus-Chat/frontend-server.py

20 lines
758 B
Python
Raw Permalink Normal View History

2023-04-30 12:16:48 +02:00
#!/usr/bin/env python3
# Copyright (c) 2023 Julian Müller (ChaoticByte)
from argparse import ArgumentParser
import uvicorn
from frontend.app import app
if __name__ == "__main__":
# CLI
ap = ArgumentParser()
ap.add_argument("--host", help="Address to listen on (default: localhost)", type=str, default="localhost")
ap.add_argument("--port", help="Port to listen on (default: 8080)", type=int, default=8080)
ap.add_argument("--api", help="URL of the API Server (default: 'http://localhost:7331')", type=str, default="http://localhost:7331")
args = ap.parse_args()
# Pass frontend config to the app
app.config.frontend_config = {"api_url": args.api.rstrip("/")}
# Run
uvicorn.run(app, host=args.host, port=args.port)