Just use a regular perl.

for my $path (qw( /css /static /images /js )) {
  mount $path => builder {
    …
  }
}


On Mon, Aug 22, 2016 at 7:38 PM ivo welch <ivo...@gmail.com> wrote:

>
> this is just an inquiry for whether there is some syntactic sugar here.  I
> have an app in mount "/", plus a few lines like:
>
>   mount "/css" => builder {
>     enable 'ConditionalGET';
>     enable 'ETag', file_etag => [qw/inode mtime size/], ;
>     enable 'ContentLength';
>     Plack::App::File->new(root => "css")->to_app;
>   };
>   mount "/images" => builder {
>     enable 'ConditionalGET';
>     enable 'ETag', file_etag => [qw/inode mtime size/], ;
>     enable 'ContentLength';
>     Plack::App::File->new(root => "images")->to_app;
>   };
>
>
> same for js, favicon.ico, and a few more.  can this be combined?  aka,
> something like
>
>   mount ("/static", "/css", "/images", "/js", "*.png", ... ) => builder {
>     enable 'ConditionalGET';
>     enable 'ETag', file_etag => [qw/inode mtime size/], ;
>     enable 'ContentLength';
>     Plack::App::File->new(root => $_)->to_app;
>   };
>
>
> this pseudo code is obvious nonsense.  it is just to show intent.  easy?
>  impossible?
>
> regards, /iaw
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "psgi-plack" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to psgi-plack+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"psgi-plack" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to psgi-plack+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to