[Dancer-users] Plack Middleware for subdomains

Matthew Vickers mvickers at quispiam.com
Sun Feb 13 11:31:22 CET 2011


Hey sawyer,

Thanks for the wow !

I am not very plack literate but I do not think this middleware would 
suit ticket 284.  It seems that harshalls wants to mount different apps 
at different subdomains.  All Dancer::Middleware::Subdomain does is set 
$env->{ SUBDOMAIN } to the subdomain, I use it so that I can map an 
account to a sub domain ala freshbooks.

Can logic be placed in the builder block ?

builder {
     if($env->{ SUBDOMAIN } eq 'foo')
     {
         mount ...
     }
     if($env->{ SUBDOMAIN } eq 'bar')
     {
         mount ...
     }
}

Perhaps someone with more perl/Dancer foo than I can hack it to fix the 
issue.

Matt

On 13/02/11 8:54 PM, sawyer x wrote:
> Wow!
>
> I think this will prove itself very useful, and we already have a 
> ticket of a person who needs exactly this behavior (GH #248).
>
> Do you think that ticket can be handled by Dancer::Middleware::Subdomain?
>
> On Sun, Feb 13, 2011 at 6:29 AM, Matthew Vickers 
> <mvickers at quispiam.com <mailto:mvickers at quispiam.com>> wrote:
>
>     Hi all,
>
>     I have a need for the use of subdomains being mapped to accounts
>     and could not find a plugin or middleware already written, so I
>     have whipped up a Dancer::Middleware::Subdomain library and have
>     it up on github.
>
>     https://github.com/mvickers/dancer_middleware_subdomain
>
>     Comments/Criticisms are welcome.
>
>     Matt
>     _______________________________________________
>     Dancer-users mailing list
>     Dancer-users at perldancer.org <mailto: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/20110213/3d45b978/attachment.htm>


More information about the Dancer-users mailing list