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