1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-22 14:25:01 +01:00

app.py: Don't initialize Solr connection

We only need Solr in the indexing component, not for the API itself.
This commit is contained in:
Alan Orth 2018-10-24 11:59:50 +03:00
parent 568ff2eebb
commit 963aa245c8
Signed by: alanorth
GPG Key ID: 0FB860CC9C45B1B9

5
app.py
View File

@ -1,10 +1,8 @@
from database import database_connection
import falcon
from solr import solr_connection
db = database_connection()
db.set_session(readonly=True)
solr = solr_connection()
class AllItemsResource:
def on_get(self, req, resp):
@ -65,6 +63,9 @@ class ItemResource:
cursor.close()
def on_exit(api):
print("Shutting down DB")
api = falcon.API()
api.add_route('/items', AllItemsResource())
api.add_route('/item/{item_id:int}', ItemResource())