summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-08-07 10:20:28 +0200
committerYorhel <git@yorhel.nl>2020-08-07 10:23:40 +0200
commitbf3c97f9812d0709c242baf5c3c0720f140158e4 (patch)
treea75230f1c80e6061bdb4db84399fad984d9159fe
parentcf52cd282546418cee32b5c42920229bd9f3b62b (diff)
index.pl: Serve static files when in direct HTTP server mode
Makes it easier to setup a quick development server.
-rwxr-xr-xwww/index.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/www/index.pl b/www/index.pl
index c02db7d..7be242e 100755
--- a/www/index.pl
+++ b/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(
qr// => \&home,
qr{info/about} => \&about,