-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add run-web-api.sh to easy launch dev mode API server (#248)
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |