-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathrun_server.py
More file actions
34 lines (27 loc) · 742 Bytes
/
run_server.py
File metadata and controls
34 lines (27 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- coding:utf-8 _*-
"""
LIB-SSE CODE
@author: Jeza Chen
@license: GPL-3.0 License
@file: run_server.py
@time: 2022/03/18
@contact: jeza@vip.qq.com
@site:
@software: PyCharm
@description:
"""
import asyncclick as click
import frontend.server.connector
from global_config import ServerConfig
@click.group()
async def cli():
pass
@cli.command()
@click.option("--host", default=ServerConfig.HOST, help='server host')
@click.option("--port", default=ServerConfig.PORT, help='port to bind', type=int)
async def start(host, port):
if host is None or port is None:
click.echo(f'Incomplete options')
await frontend.server.connector.run_server(host, port)
if __name__ == '__main__':
cli(_anyio_backend="asyncio")