summaryrefslogtreecommitdiff
path: root/util/vndb.pl
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2017-12-06 21:16:19 +0100
committerYorhel <git@yorhel.nl>2017-12-06 21:16:19 +0100
commitfe407fe3ec01deba81a6eee896699c65a0566426 (patch)
treef7ceae1646f7dae02525c7f6b462896a2625cef5 /util/vndb.pl
parent489603502533761684d3f098f4efc8fa3a92b3ff (diff)
Add instructions for running VNDB as standalone web server
Diffstat (limited to 'util/vndb.pl')
-rwxr-xr-xutil/vndb.pl8
1 files changed, 8 insertions, 0 deletions
diff --git a/util/vndb.pl b/util/vndb.pl
index b91aac56..46ff9e0d 100755
--- a/util/vndb.pl
+++ b/util/vndb.pl
@@ -50,6 +50,14 @@ TUWF::run();
sub reqinit {
my $self = shift;
+ # If we're running standalone, serve www/ and static/ too.
+ if($TUWF::OBJ->{_TUWF}{http}) {
+ if($self->resFile("$ROOT/www", $self->reqPath) || $self->resFile("$ROOT/static", $self->reqPath)) {
+ $self->resHeader('Cache-Control' => 'max-age=31536000');
+ return 0;
+ }
+ }
+
# check authentication cookies
$self->authInit;