From e6c606ac93ab5fe155234204fed4828178eac12c Mon Sep 17 00:00:00 2001 From: schneefux Date: Sun, 5 Feb 2017 13:06:24 +0100 Subject: api: allow to be run from the root directory --- api.py | 6 +++--- 1 file 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) -- cgit v1.3.1