From 236fd1d9f2009083fbbfce7190c27fbf1d7c88b8 Mon Sep 17 00:00:00 2001 From: yo mama Date: Fri, 7 Aug 2015 18:33:30 -0700 Subject: getting ready --- frontend/impattern/app.pl | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 frontend/impattern/app.pl (limited to 'frontend/impattern/app.pl') 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; -- cgit v1.2.3-70-g09d2