diff --git a/README.md b/README.md index c229782..1352b6f 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ $ curl http://localhost:5000 ## Deployment -Configuration files are located at `env.local` and `uwsgi.ini`. +Configuration files are located at `.env.local` and `uwsgi.ini`. A production ready uWSGI daemon (uwsgi socket exposed on port 5001) can be started with: diff --git a/main.py b/main.py index 68281c6..cf847fc 100644 --- a/main.py +++ b/main.py @@ -275,8 +275,8 @@ def api_hadiths_by_refs(): @app.route("/v1/hadiths/random", methods=["GET"]) @single_resource def api_hadiths_random(): - # TODO Make this configurable instead of hardcoding - return Hadith.query.filter_by(collection="riyadussalihin").order_by(func.rand()) + collection = request.args.get("collection", "riyadussalihin") + return Hadith.query.filter_by(collection=collection).order_by(func.rand()) if __name__ == "__main__": diff --git a/requirements.txt b/requirements.txt index aafd2a5..557715a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -32,6 +32,6 @@ six==1.15.0 SQLAlchemy==1.3.17 toml==0.10.1 virtualenv==20.36.1 -Werkzeug==3.1.5 +Werkzeug==2.2.3 wrapt==1.12.1 zipp==3.15.0 diff --git a/spec.v1.yml b/spec.v1.yml index 4f49a8f..4aa7939 100644 --- a/spec.v1.yml +++ b/spec.v1.yml @@ -178,7 +178,7 @@ paths: type: string - in: path name: chapterId - description: Number of the book + description: ID of the chapter required: true schema: type: number