18 lines
576 B
Python
18 lines
576 B
Python
import uvicorn
|
|
from server import app
|
|
from daemon.SimpleDaemon import Daemon
|
|
|
|
|
|
class CdnServerDaemon(Daemon):
|
|
def run(self):
|
|
uvicorn.run("server:app", host='0.0.0.0', port=5044, log_level="info")
|
|
|
|
|
|
# Press the green button in the gutter to run the script.
|
|
if __name__ == '__main__':
|
|
# uvicorn.run("server:app", host='0.0.0.0', port=5044, log_level="info", reload=True)
|
|
with CdnServerDaemon('/tmp/daemon-cdn-server.pid', error_log_file='errlog.txt') as daemon:
|
|
daemon.process_command()
|
|
|
|
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
|