pedestal

simongray 2020-11-04T11:03:48.112800Z

I was thinking it could make sense to set my own namespaced key in the service map and allow my interceptors to read configuration from that. Is that advisable? And is it even possible for an interceptor to read keys in the service map?

simongray 2020-11-04T11:05:23.114300Z

The point was just to have an alternative to calling a bunch of interceptor constructor functions. Integrating with the Pedestal service map would also gather more configuration in the same place. So for instance I might write:

{::http/type :jetty
 ::http/port 8080
 ::http/routes #{...}
 :my.own.ns/config {...}}

souenzzo 2020-11-04T11:32:32.114700Z

I use this add-service-map in most of the apps that i develop https://github.com/souenzzo/graph-demo/blob/master/src/main/souenzzo/graph_demo/core.clj#L156

simongray 2020-11-04T11:40:10.115Z

@souenzzo Perfect! I guess this does not come built in then. Do you also keep your own custom keys in the service map or do you just this interceptor to read some of the standard keys?

souenzzo 2020-11-04T11:48:55.115200Z

I use a lot of custom keys. including things like "db connection" and other things