[web-devel] web-devel Digest, Vol 71, Issue 1

Julian Arni jkarni at gmail.com
Mon Oct 26 13:30:18 UTC 2015


(Sorry for the delay, was away for the weekend.)



On Sat, Oct 24, 2015 at 2:05 AM, Greg Weber <greg at gregweber.info> wrote:

> Yes, that is all very clear. My contention is that one should not have
> overlapping routes, particularly when mounting an Application.
> If an Application is mounted at /route, then it should be clear that
> /route* should belong to the Application.
>
> For example, with Yesod, Yesod "stands in front", but one often mounts
> wai-app-static at /static and Yesod will statically enforce that you don't
> create another static/* route anywhere else.
>
> What is the use case for having one framework "stand in front" such that
> it requires overlapping, or what is the use case for overlapping otherwise?
>
> Well, my thought was that Application is, modulo this one problem, already
a way of sharing handlers (or sets of handlers) between frameworks. If
overlaps are handled nicely, one can combine different web frameworks very
neatly. This seems to achieve the original aim, but maybe I'm missing some
of the motivation for a common handler?

As for a use case for standing-in-front, it's sort of a nice way to have
something like a reverse proxy that captures some endpoints rather than
proxying them to the underlying service, without the actual overhead of
external requests. I imagine there are other use-cases.

Finally, it seems like if we had a good story about Applications working
anywhere - in particular, converting one or more endpoints to Application
and then mounting them in the same place not changing the behaviour of the
overall Application - it would be quite easy for all web frameworks to
apply Middleware to a subset of endpoints rather than all of them.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/web-devel/attachments/20151026/7244d8ab/attachment.html>


More information about the web-devel mailing list