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:
parent
cf52cd2825
commit
bf3c97f981
1 changed files with 10 additions and 0 deletions
10
www/index.pl
10
www/index.pl
|
|
@ -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(
|
TUWF::register(
|
||||||
qr// => \&home,
|
qr// => \&home,
|
||||||
qr{info/about} => \&about,
|
qr{info/about} => \&about,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue