diff options
| author | yo mama <pepper@scannerjammer.com> | 2015-09-22 00:51:40 -0700 |
|---|---|---|
| committer | yo mama <pepper@scannerjammer.com> | 2015-09-22 00:51:40 -0700 |
| commit | d3e7b5708deffbed864c916de22663f48333c58b (patch) | |
| tree | ef76784a7827baff88c03670bf22832a3f146b17 /share/frontend/impattern/app.pl | |
| parent | 86c79f4372d7b2e7640a26473c7a4d331cdf7d16 (diff) | |
finishing server
Diffstat (limited to 'share/frontend/impattern/app.pl')
| -rw-r--r-- | share/frontend/impattern/app.pl | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/share/frontend/impattern/app.pl b/share/frontend/impattern/app.pl new file mode 100644 index 0000000..b1bfc3c --- /dev/null +++ b/share/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; |
