Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spec.v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down