w2v-server: serve js directly for better portability
diff --git a/w2v-server.pl b/w2v-server.pl
index 85a7e25..3cb6aa3 100755
--- a/w2v-server.pl
+++ b/w2v-server.pl
@@ -8,6 +8,9 @@
use Encode qw(decode encode);
use Getopt::Std;
use Mojo::Server::Daemon;
+use Cwd;
+app->static->paths->[0] = getcwd;
+
plugin 'Log::Access';
plugin "RequestBase";
@@ -69,6 +72,14 @@
filter_garbage();
}
+get '/derekovecs/js/*' => sub {
+ my $c = shift;
+ my $url = $c->req->url;
+ $url =~ s@/derekovecs@@g;
+ $c->app->log->info("GET: " . $url);
+ $c->reply->static($url);
+};
+
get '/' => sub {
my $c = shift;
$c->app->log->info("get: ".$c->req->url->to_abs);