configuration - Configuring directory aliases in Starman (or other PSGI servers) -
i used setting aliases different directories in apache httpd.conf. example, following works me
alias /lib /path/to/lib
then can include paths such <script src="/lib/jquery/plugin/funky.js"></script>
no matter application path.
i trying out starman (and other psgi servers such http::server::psgi), , can't figure out way set configuration parameters such alias directories.
can done? how?
it can done using plack::middleware::static.
use plack::builder; builder { enable "static", path => sub { s!^/lib/!! }, root => "/path/to/lib/"; $app; };
and you'll "/lib/foo.js" loaded "/path/to/lib/foo.js". should work starman , psgi supported web servers.
more information available in the online documenetation.
Comments
Post a Comment