Fork me on GitHub
#yada
<
2016-10-10
>
grav05:10:13

Iā€™m using Cursive, and it has the ability to launch the debugger, if an unhandled exception is thrown. However, Yada handles any exception by responding with HTTP 500. Can I change this behaviour so that I can use the debugger?

jmglov12:10:19

Can anyone point to a working example of a redirect resource? I keep getting an exception about no :uri-info available in the context.

dominicm13:10:32

@jmglov Redirect only works if, when launching your yada handler something adds a :uri-info key to the context.

dominicm13:10:39

The easiest solution is to use bidi.vhosts

dominicm13:10:19

I think this was recently changed, so make sure that yada and bidi are up to date.

jmglov13:10:04

@dominicm OK, thanks. What should the value of the :uri-info key look like?

jmglov13:10:50

I'm not actually serving multiple vhosts, however. This looks a little complicated for a simple redirect.

jmglov13:10:05

At the moment, I'm just doing it manually.

jmglov13:10:43

Read "I'm doing" as " @johanwiren's doing". šŸ˜‰

dominicm13:10:49

@jmglov I believe the reason for this is down to differing requirements around full/partial/relative paths.

dominicm13:10:59

uri-info should be a function that returns a map.

dominicm13:10:40

@jmglov Those requirements, I should add, are down to the HTTP spec ( I think ). But @malcolmsparks would have to clarify there.

dominicm13:10:17

Like I said - easiest solution is just to use bidi.vhosts with the vhost coming from a config option of some kind.

malcolmsparks13:10:51

the problem is if you're wanting to use yada/uri-for in which case you should be using yada/server. Otherwise, you can use bidi's path-for function. The reason for this is that yada needs (sometimes) to generate absolute URIs as well as relative paths (as dictated by the spec.), so things are a little more complex. However, vhosts isn't hard to setup, and you can use a wildcard if you don't want to specify the host/port

dominicm13:10:01

@malcolmsparks In the case of wildcards, how are absolute paths generated?

stijn14:10:36

not sure if that is the right solution though, please review šŸ™‚