index.pl: Serve static files when in direct HTTP server mode

Makes it easier to setup a quick development server.
This commit is contained in:
Yorhel 2020-08-07 10:20:28 +02:00
parent cf52cd2825
commit bf3c97f981

View file

@ -44,6 +44,16 @@ TUWF::set(
);
TUWF::hook before => sub {
if(tuwf->{_TUWF}{http}) {
if(tuwf->resFile("$ROOT/www", tuwf->reqPath)) {
tuwf->resHeader('Cache-Control' => 'max-age=31536000');
tuwf->done;
}
}
};
TUWF::register(
qr// => \&home,
qr{info/about} => \&about,