forked from dr34m-cn/taosync
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
22 lines (17 loc) · 635 Bytes
/
Copy pathmain.py
File metadata and controls
22 lines (17 loc) · 635 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import asyncio
import logging
from common.httpApp import make_app, resolve_front_dir
from common.config import getConfig
from common.LNG import G
from service.system import onStart
async def main(server_cfg, front_dir):
app = make_app(server_cfg, front_dir)
logger = logging.getLogger()
app.listen(server_cfg['port'], address='0.0.0.0')
successMsg = G('running_success').format(url=f"http://0.0.0.0:{server_cfg['port']}/")
logger.critical(successMsg)
await asyncio.Event().wait()
if __name__ == "__main__":
onStart.init()
cfg = getConfig()
asyncio.run(main(cfg['server'], resolve_front_dir()))