Allow configuring host, port or unix socket of server via CLI

This commit is contained in:
Debanjum Singh Solanky
2021-10-02 16:16:33 -07:00
parent 866ccb5cd3
commit c47a8cdf16
2 changed files with 8 additions and 2 deletions

View File

@@ -1,6 +1,5 @@
# Standard Packages
import sys
import pathlib
from typing import Optional
# External Packages
@@ -121,4 +120,7 @@ if __name__ == '__main__':
model, search_config = initialize_search(args.config, args.regenerate, args.verbose)
# Start Application Server
uvicorn.run(app)
if args.socket:
uvicorn.run(app, proxy_headers=True, uds=args.socket)
else:
uvicorn.run(app, host=args.host, port=args.port)