From d722fc253cc9a14de9ca79efc7b51720f359f2f6 Mon Sep 17 00:00:00 2001 From: Konrad Rokicki Date: Sun, 1 Dec 2024 20:40:28 -0500 Subject: [PATCH] replaced run.py with run.sh --- docs/Development.md | 4 ++-- run.py | 23 ----------------------- run.sh | 1 + 3 files changed, 3 insertions(+), 25 deletions(-) delete mode 100755 run.py create mode 100755 run.sh diff --git a/docs/Development.md b/docs/Development.md index 801f2f6..d66608b 100644 --- a/docs/Development.md +++ b/docs/Development.md @@ -8,10 +8,10 @@ Create a virtualenv and install the dependencies: source env/bin/activate pip install -r requirements.txt -The service is written using FastAPI and runs inside of Uvicorn. You can start a dev server quickly with the `run.py` helper script: +The service is written using FastAPI and runs inside of Uvicorn. You can start a dev server quickly with the `run.sh` helper script: ```bash -./run.py --port 8000 +./run.sh ``` This is equivalent to running Uvicorn directly, like this: diff --git a/run.py b/run.py deleted file mode 100755 index 41c7332..0000000 --- a/run.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python -""" Run a development server using Uvicorn. -""" - -import argparse -import uvicorn -from x2s3.app import app - -if __name__ == "__main__": - - argparser = argparse.ArgumentParser(description=__doc__, - formatter_class=argparse.RawDescriptionHelpFormatter) - argparser.add_argument( - "-p", - "--port", - type=int, - default=8000, - help="port number for API", - ) - args = argparser.parse_args() - - uvicorn.run(app, host='0.0.0.0', port=args.port) - diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..4ee7ee3 --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +uvicorn x2s3.app:app --host 0.0.0.0 --port 8000 --workers 1 --access-log --reload