Fork me on GitHub
#yada
<
2017-04-20
>
geek-draven14:04:26

I've having an issue using new-classpath-resource and custom responses. If I use [true (yada/resource {:responses {404 {:produces #{"text/html" "text/plain;q=0.9"} :response... it overwrites ["" (new-classpath-resource "static" {:index-files ["login.html"]}] so all my css, images, js, etc doesn't get loaded. Is there a way to have both?

malcolmsparks14:04:29

Copy the new-classpath-resource code out of yada. Brute force method. Or write a custom bidi matcher.

malcolmsparks14:04:41

Sorry, no easy answer

malcolmsparks14:04:16

The code to copy is not too bad however, and copy and paste is a wonderful dev technique

geek-draven14:04:51

thanks, I'll give that a go

borkdude16:04:43

We are close to deploying our service which is ported to Yada. One thing we need to do is turn off those stack traces when you get an error. In part 5.1.8. Responses of the Yada manual I read you have to do this by overriding the :responses key. I bet there is no flag here like :production true that just dismisses the stacktraces?

malcolmsparks16:04:38

No, but you can override the error interceptor chain to handle errors

borkdude16:04:53

I’ll have a look at that then. Thanks 🙂

malcolmsparks16:04:11

There is thought to a more prod friendly 'profile' of yada. Has been trialled on another branch.

borkdude18:04:55

When a client says, I accept content types a, b, and c and a Yada resources can produce a, b and c, there is no real preference/order, unless you use q right?

malcolmsparks18:04:09

And you can use q on the server too