Fork me on GitHub
#pedestal
<
2017-04-03
>
jimmy02:04:13

Do you guys know if I assign ::http/interceptors [] , even it's an empty vector, then when there is an error, the only message I got is : Internal server error : no response. if I don't have ::http/interceptors, it returns a nice stack trace for me to debug. What is the right way to provide default interceptors on current service ?

jimmy05:04:20

https://www.youtube.com/watch?v=_Cf-STRvFy8 Great talk, cannot wait to see pedestal chain on clojurescript !

rauh05:04:14

@nxqd Just update conj the ::http/interceptors after you put called the default-interceptors. (Without the :http/interceptors since if default-interceptors sees that map key it won't do anything.)

borkdude18:04:11

Is content negotiation + coercion a manual practice like described in http://pedestal.io/guides/hello-world-content-types or is there some provided sane defaults in Pedestal?

ddeaguiar18:04:27

@borkdude, AFAIK that’s how it’s done.

crimeminister19:04:31

Hi all, is this the right place for Vase-related questions or should I take it to #vase?

ddeaguiar19:04:13

@crimeminister not sure who’s using #vase. I think this is the right place for now.

crimeminister19:04:43

Am wondering about the possibility of using specs defined in an external library; getting Unable to resolve spec: :com.example/some-spec when I try. Anyone know if this is supported?

crimeminister19:04:13

I should go spelunking, but figured it couldn't hurt to ask first ;)

ddeaguiar19:04:11

So I assume you mean specs that are registered via s/def, correct?

ddeaguiar19:04:08

If so then I don’t see why that wouldn’t work. I imagine you need to require the appropriate namespaces before reading in the vase descriptor(s)

crimeminister19:04:40

Cool, I will give it another whirl, thank you

crimeminister19:04:04

That worked, much appreciated

ddeaguiar19:04:44

np, glad to help!

crimeminister19:04:51

Am wondering: would it make sense to provide a list of namespaces to require as part of the Vase edn config?

ddeaguiar19:04:06

I think that’s app-specific. You normally won’t need much more than what’s defined in the service.clj file which is created by the Vase lein template.

ddeaguiar19:04:49

Remember specs are registered globally. They’re actually stored in an atom defined in the spec ns.

ddeaguiar19:04:13

They get registered when the ns they are defined in is evaluated

ddeaguiar19:04:29

This means that specs defined in your descriptor(s) are also available elsewhere in your Vase-enabled app

crimeminister19:04:58

Agreed, just thinking that on occasion it might be useful to specify a namespace to evaluate as part of Vase config so the spec can be used by a #vase/validate without a having to touch server/service.clj. Minor thing though.

crimeminister19:04:17

Didn't realize that was how spec was implemented; interesting

ddeaguiar19:04:59

Oh, I see what you are asking for

crimeminister19:04:49

I have several apps all using shared specs in a library, just pulling those into the Vase microservice I am playing with

ddeaguiar19:04:54

Hmm, IMO the convenience does not outweigh the trouble of implementing and supporting such a feature.

crimeminister19:04:19

Quite likely, and not sure how common this pattern is anyways

crimeminister19:04:41

No doubt others will chime in if it might be useful ;)

borkdude20:04:39

Does anyone got an example how to load resources from a jar? I tried this:

(def font-awesome-webjars-resource-path “META-INF/resources/webjars/font-awesome/4.7.0”)
…
service-map {::http/routes routes
                            ::http/type   :jetty
                            ::http/join?  false
                            ::http/resource-path "/public"
                            ;; Doesn't work yet
                            ::http/default-interceptors [(middlewares/resource
                                                          font-awesome-webjars-resource-path)
                                                         ]
                            ::http/port port}

crimeminister22:04:31

I think you might want to look at , specifically (io/resource …)

crimeminister22:04:59

Am in transit, otherwise would post a more substantial example, sorry