From b8356f7a875a41b77df2910a471f14790c3ab0c6 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Fri, 26 Oct 2018 18:21:27 +0200 Subject: [PATCH] Add "application" alias to API object By default gunicorn looks for an "application" object to run, so this saves us having to type api:app. --- README.md | 2 +- dspace_statistics_api/app.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1334a2f..c4058b4 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Index the Solr statistics core to populate the PostgreSQL database: Run the REST API: - $ gunicorn dspace_statistics_api.app:api + $ gunicorn dspace_statistics_api.app Test to see if there are any statistics: diff --git a/dspace_statistics_api/app.py b/dspace_statistics_api/app.py index 0801f25..8cf5798 100644 --- a/dspace_statistics_api/app.py +++ b/dspace_statistics_api/app.py @@ -66,7 +66,7 @@ class ItemResource: def on_exit(api): print("Shutting down DB") -api = falcon.API() +api = application = falcon.API() api.add_route('/items', AllItemsResource()) api.add_route('/item/{item_id:int}', ItemResource())