diff --git a/README.md b/README.md index 15f7b4c..d7be2bd 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,12 @@ For information on spinning up your own dev Web API server locally, have a look DEVELOPMENT=1 uvicorn readalongs.web_api:web_api_app --reload +or + + ./run-web-api.sh + +Note that the production command line for the Web API is defined in [Procfile](Procfile) and documented in [web\_api.py](readalongs/web_api.py). + #### /langs To query a list of available languages in the ReadAlong Studio API, send a GET request to https://readalongs-studio.herokuapp.com/api/v1/langs diff --git a/run-web-api.sh b/run-web-api.sh new file mode 100755 index 0000000..54abc17 --- /dev/null +++ b/run-web-api.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +# Convenience script to launch the Web API in development mode. +# Do not use in production! (See ../Procfile for the prod launch command.) +# +# Usage: +# pip install uvicorn +# /path/to/run-web-api.sh +# +# Further documentation is in readalongs/web_api.py + +# Move to the code root directory, so that --reload works correctly. +CODE_ROOT_PATH=$(dirname $(realpath $0))/readalongs +cd $CODE_ROOT_PATH + +# Launch the Web API with the --reload option, which will automatically reload +# the server whenver the code changes. +DEVELOPMENT=1 uvicorn readalongs.web_api:web_api_app --reload