Skip to content

Commit

Permalink
Merge pull request #45 from dbrattli/fix-autocomplete
Browse files Browse the repository at this point in the history
Fix auto-complete example
  • Loading branch information
dbrattli authored Jan 19, 2024
2 parents c65b019 + bb29220 commit 3574d01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/autocomplete/autocomplete.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async def index(request: Request) -> dict[str, Any]:
async def init(loop: AbstractEventLoop):
port = os.environ.get("PORT", 8080)
host = "localhost"
app = web.Application(loop=loop)
app = web.Application()
print("Starting server at port: %s" % port)

aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader("."))
Expand All @@ -102,7 +102,7 @@ async def init(loop: AbstractEventLoop):


def main():
loop: AbstractEventLoop = asyncio.get_event_loop()
loop = asyncio.get_event_loop()
app, host, port = loop.run_until_complete(init(loop))
web.run_app(app, host=host, port=int(port))

Expand Down

0 comments on commit 3574d01

Please sign in to comment.