summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-02-05 13:06:24 +0100
committerschneefux <schneefux+commit@schneefux.xyz>2017-02-05 13:25:45 +0100
commite6c606ac93ab5fe155234204fed4828178eac12c (patch)
tree93bb08ec325c5f6109e1fc35a870017e1d05c7b8
parent782d0d1c18d11676e46aae0909e20c33effe5942 (diff)
downloadapigrabber-e6c606ac93ab5fe155234204fed4828178eac12c.tar.gz
apigrabber-e6c606ac93ab5fe155234204fed4828178eac12c.zip
api: allow to be run from the root directory
-rw-r--r--api.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/api.py b/api.py
index 5f7ca29..611532b 100644
--- a/api.py
+++ b/api.py
@@ -37,7 +37,7 @@ async def recrawl():
ORDER BY data->'attributes'->>'createdAt' DESC LIMIT 1
""")
)[0]["created"]
- except IndexError:
+ except:
last_match_update = "2017-02-05T01:01:01Z"
matches = await api.matches_since(last_match_update, region=region)
@@ -74,9 +74,9 @@ async def api_status(_):
loop = asyncio.get_event_loop()
loop.run_until_complete(db.connect("postgres://vgstats@localhost/vgstats"))
-loop.run_until_complete(queries.load_queries("queries/"))
+loop.run_until_complete(queries.load_queries("api/queries/"))
loop.create_task(recrawl())
app = aiohttp.web.Application(loop=loop)
route.add_to_router(app.router)
-app.router.add_static("/web", "../web-dev") # development web frontend
+app.router.add_static("/web", "web-dev") # development web frontend
aiohttp.web.run_app(app)