Fork me on GitHub
#pedestal
<
2017-09-15
>
mtnygard15:09:54

@kommen If you're using handlers, then it is totally fine to assoc the DB and connection onto the request.

mtnygard15:09:12

We support handler functions because they're familiar to people who come from Ring or Rack

mtnygard15:09:54

But a handler function really just gets wrapped into an interceptor that passes the request to the handler and assoc's the return as the response. In other words, it's purely a convenience.

mtnygard15:09:31

In my own apps, I don't use handlers. I just write everything as interceptors. I find that gives me more opportunities to make small interceptors that I can recompose for different routes. (That's what the example in your-first-api does.)