[Dancer-users] Global app-wide "prefix" settings

Brian E. Lozier brian at massassi.com
Wed Sep 28 22:22:22 CEST 2011


On Wed, Sep 28, 2011 at 1:17 PM, Assaf Gordon <gordon at cshl.edu> wrote:

> Brian E. Lozier wrote, On 09/28/2011 04:14 PM:
> >
> >
> > On Wed, Sep 28, 2011 at 1:07 PM, Assaf Gordon <gordon at cshl.edu <mailto:
> gordon at cshl.edu>> wrote:
> >
> >     Has anyone been able to deploy a Dancer application *not* under the
> server's root URL,
> >     without changing code/templates in the Dancer application itself ?
> >
> > The only thing I can think of is to rewrite the html on the way out such
> that all calls to /images/ get the prefix.  The problem is that all your
> templates are hard coding a path to a resource on the server.  You're
> telling the browser what resource to request and you're giving it an
> "absolute" path.  You could also give them "relative" paths such as:
> >
> > <img src="images/foo.png">
> >
> > Which will work fine as long as you don't have any routes that are
> deeper.
> >
> > Why don't you just have a configuration parameter in your config file
> that says "path" and then use that instead of "[% request.uri_base %]"?  I
> don't quite get why you're using uri_base anyway.  All you have to do is
> say:
>
> This configuration parameter is exactly what started this thread (The
> app-wide "prefix" setting - in the subject line) :)
> And I keep learning that it's a bad idea, but haven't yet understood how to
> do it without such parameter.
>

I'm suggesting creating a new config variable for your apps, not reusing the
prefix one.  Although I'm not sure why you wouldn't want to use the prefix
one, I'll go back and read the beginnings of the thread.


> _______________________________________________
> Dancer-users mailing list
> Dancer-users at perldancer.org
> http://www.backup-manager.org/cgi-bin/listinfo/dancer-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20110928/9adb23d5/attachment.htm>


More information about the Dancer-users mailing list