summaryrefslogtreecommitdiff
path: root/app.pl
diff options
context:
space:
mode:
authoryo mama <pepper@scannerjammer.com>2015-02-13 02:42:02 -0800
committeryo mama <pepper@scannerjammer.com>2015-02-13 02:42:02 -0800
commitfd640b170a64584fd9c295be53c91972ff9f9ec1 (patch)
treec67e95b332e183bbf14065bba55dd77e86a71fbe /app.pl
parent64f41d53728a966f10aef6d7ffbc00853d754300 (diff)
fixed some basics
Diffstat (limited to 'app.pl')
-rw-r--r--app.pl34
1 files changed, 34 insertions, 0 deletions
diff --git a/app.pl b/app.pl
new file mode 100644
index 0000000..b1bfc3c
--- /dev/null
+++ b/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;