from aiohttp import web


async def default(request):
    print("DEFAULT")
    print(request)
    print(request.headers)
    return web.HTTPOk(
        body="HELLO WORLD"
    )

async def authenticate_request(request):
    print("AUTH")
    print(request)
    print(request.headers)
    return web.HTTPOk()

# exercised with:
# - traefik fwdauth pointing at /auth
# - httpie with a cookie header

if __name__ == "__main__":
    app = web.Application()
    app.add_routes([web.get("/", default)])
    app.add_routes([web.get("/auth", authenticate_request)])
    web.run_app(app)
