Hi I'm trying to ensure that every request has a cookie before the request gets to my routes (and initialise a new one if one doesn't exist already). I'm coming from NodeJS/Express so I'm looking the the middleware equivalent. Do I need to write a custom feature for this or is there an easier way to intercept the request and add the cookie if its not there already?
In addition to this I'd like to have a authOnly high order function to deny access to certain routes ... i suppose i could do something like
get("/path") = authOnly { ... }
? but figured there's a common approach to solving these?