Пример #1
0
def main(ip: str, port: int):
    if sys.platform == "win32":
        loop = asyncio.ProactorEventLoop()
        asyncio.set_event_loop(loop)

    open_url(f"http://{ip}:{port}/")
    uvicorn.run(app, host=ip, port=port, log_level="error")
Пример #2
0
def main(ip: str, port: int, only_api: bool = False):
    if sys.platform == "win32":
        loop = asyncio.ProactorEventLoop()
        asyncio.set_event_loop(loop)

    app.state.only_api = only_api

    prepare_services()

    if not only_api:
        open_url(f"http://{ip}:{port}/")

    uvicorn.run(app, host=ip, port=port, log_level="error")
Пример #3
0
def main(ip: str, port: int):
    open_url(f"http://{ip}:{port}/")
    uvicorn.run(app, host=ip, port=port, log_level="error")