summaryrefslogtreecommitdiff
path: root/frontend/impattern/app.pl
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-08-07 18:33:30 -0700
committeryo mama <pepper@scannerjammer.com>2015-08-07 18:33:30 -0700
commit236fd1d9f2009083fbbfce7190c27fbf1d7c88b8 (patch)
tree6077ff15b4b770b4b292aaa14d9cbfff1ba82fae /frontend/impattern/app.pl
parentc89619f1b1f908d0f330c468866cea669ce8bf6c (diff)
getting ready
Diffstat (limited to 'frontend/impattern/app.pl')
-rw-r--r--frontend/impattern/app.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/frontend/impattern/app.pl b/frontend/impattern/app.pl
new file mode 100644
index 0000000..b1bfc3c
--- /dev/null
+++ b/frontend/impattern/app.pl
@@ -0,0 +1,34 @@
+#!/usr/bin/env perl
+use Dancer2;
+use Data::Dumper;
+set public => './';
+
+get '/download/*.*' => sub {
+ my ($file, $ext) = splat;
+ # do something with $file.$ext here
+};
+
+get qr{/img/([\w\.\-_]+)} => sub {
+ my ($filename) = splat;
+ send_file sprintf("/img/%s", $filename);
+};
+get qr{/patterns/([\w\.\-_]+)} => sub {
+ my ($filename) = splat;
+ send_file sprintf("/patterns/%s", $filename);
+};
+get qr{/css/([\w\.\-_]+)} => sub {
+ my ($filename) = splat;
+ send_file sprintf("/css/%s", $filename);
+};
+get qr{/js/([\w\.\-_]+)} => sub {
+ my ($filename) = splat;
+ send_file sprintf("/js/%s", $filename);
+};
+get qr{/fonts/([\w\.\-_]+)} => sub {
+ my ($filename) = splat;
+ send_file sprintf("/fonts/%s", $filename);
+};
+get '/' => sub {
+ send_file ("index.html");
+};
+dance;