I am working on a project and using Plack for the first time. I am having a little problem getting my static files served...
Directory structure:
app/test.psgi
app/pod-files/test.pod
app/static/test.html
app/html-files/test.html
The code I have for the builder part in test.psgi is:
builder {
enable "Static",
path => qr!^/static!,
;
enable "Plack::Middleware::Pod", # great module!
path => qr!^/pod!,
root => 'pod-files',
pod_view => 'Pod::POM::View::HTML',
;
$app;
};
The pod and static files serve up fine:
/app/pod/test.pod OK
/app/static/test.html OK
But I want to serve the static files from a different directory to static, so I change the builder to:
builder {
enable "Static",
path => qr!^/static!,
root => 'html-files',
;
enable "Plack::Middleware::Pod",
path => qr!^/pod!,
root => 'pod-files',
pod_view => 'Pod::POM::View::HTML',
;
$app;
};
But, this doesnt work - I now get:
/app/pod/test.pod OK
/app/static/test.html not found
I have played around with different values of 'root' but no luck. Any help appreciated.
** Update: managed to work it out - see my comment below
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.