[dancer-users] Proposed plugin Dancer2::Plugin::RootURIFor
john at jbrt.org
Tue Apr 14 19:05:43 BST 2015
Following some discussion on #dancer today, I have a couple of
questions. Firstly, before I go ahead and wrap this in tests and
CPAN-ify it, does it seem useful?
Dancer2::Plugin::RootURIFor provides root_uri_for, which is the same as
uri_for except it ignores your application's mount point / base path.
The use-case for this is if you have multiple applications and would
like to construct links between them (or to other resources) which
retain URI scheme, host, port etc.
e.g. You have two apps, mounted on /app1 and /app2. Calling:
...from app1 will give you 'http://.../app1/app2'. Calling:
...from app1 will give you 'http://.../app2'.
Secondly, is there a better or more idiomatic way to achieve this? Does
this function already exist?
More information about the dancer-users