-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/molstar/molstar-volseg
- Loading branch information
Showing
3 changed files
with
65 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,25 @@ | ||
import argparse | ||
from pathlib import Path | ||
import uvicorn | ||
from cellstar_server.app.settings import settings | ||
|
||
if __name__ == "__main__": | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--ssl_keyfile", type=str) | ||
parser.add_argument("--ssl_certfile", type=str) | ||
args = parser.parse_args() | ||
|
||
print("Mol* Volume Server") | ||
print(settings.dict()) | ||
|
||
uvicorn.run( | ||
app="main:app", host=settings.HOST, port=settings.PORT, reload=settings.DEV_MODE | ||
) | ||
if args.ssl_certfile and args.ssl_keyfile: | ||
uvicorn.run( | ||
app="main:app", host=settings.HOST, port=settings.PORT, reload=settings.DEV_MODE, | ||
ssl_keyfile=str(Path(args.ssl_keyfile).resolve()), | ||
ssl_certfile=str(Path(args.ssl_certfile).resolve()) | ||
) | ||
if not args.ssl_certfile and not args.ssl_keyfile: | ||
uvicorn.run( | ||
app="main:app", host=settings.HOST, port=settings.PORT, reload=settings.DEV_MODE | ||
) | ||
else: | ||
print("ssl_certfile or ssl_keyfile was not provided") |