pycdn/main.py

18 lines
531 B
Python
Raw Normal View History

2023-03-22 18:22:43 +03:00
import uvicorn
from server import app
from daemon.SimpleDaemon import Daemon
2023-03-21 23:58:22 +03:00
2023-03-22 18:22:43 +03:00
class CdnServerDaemon(Daemon):
def run(self):
uvicorn.run("server:app", port=5000, log_level="info")
2023-03-21 23:58:22 +03:00
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
2023-03-22 18:26:38 +03:00
# uvicorn.run("server:app", port=5000, log_level="info")
2023-03-22 18:22:43 +03:00
with CdnServerDaemon('/tmp/daemon-cdn-server.pid', error_log_file='errlog.txt') as daemon:
daemon.process_command()
2023-03-21 23:58:22 +03:00
# See PyCharm help at https://www.jetbrains.com/help/pycharm/