from ancalagon import App
from ancalagon.responses import JSONResponse
async def hello(request):
return JSONResponse({'hello': 'world'})
app = App()
app.route('/', hello)
app = App(middlewares=[])
app.route('/', hello, middlewares=[])
app.route('/', hello, ignore_middlewares=[])
In your app you need authorization validation on all routes except login. You set validation_middleware
(check cookies or headers) to App middlewares, and set it to ignore_middlewares
of login route.
Inspired by:
Burzum
Summoning
Balrog
Windir
Gorgoroth