summaryrefslogtreecommitdiff
path: root/app.pl
diff options
context:
space:
mode:
authorPepper <pepper@scannerjammer.com>2015-02-13 04:01:18 -0500
committerPepper <pepper@scannerjammer.com>2015-02-13 04:01:18 -0500
commit13ef227e89c49f4a4ae40c524cad441971f84afc (patch)
tree518aff542c9502e6c22a5f47633ebf385b70a9c8 /app.pl
parent32785e06cd47fc6c5c64c7e9c077769a462ae5ea (diff)
calling it done for now
Diffstat (limited to 'app.pl')
-rw-r--r--app.pl74
1 files changed, 0 insertions, 74 deletions
diff --git a/app.pl b/app.pl
deleted file mode 100644
index b0aca9c..0000000
--- a/app.pl
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/usr/bin/env perl
-use Dancer;
-use Data::Dumper;
-use Data::UUID;
-
-sub create_uuid{
- my $ug = Data::UUID->new;
- my $uuid1 = $ug->create();
- return $uuid1;
-# $uuid2 = $ug->create_from_name(<namespace>, <name>);
-#
-# $res = $ug->compare($uuid1, $uuid2);
-#
-# $str = $ug->to_string( $uuid );
-# $uuid = $ug->from_string( $str );
-}
-
-sub cleanup{
- my $tmpdir = shift;
- my $clean_exec = system("rm -r ${tmpdir}");
- if( $clean_exec){
- return { error => "Unable to cleanup tempdir" }
- }
-}
-
-sub resize_texture {
- my $img = shift;
- my $tmpdir = shift;
- my $tmp_img = $img;
- $tmp_img =~ s/\./00./g;
- my $exec_im = system ("imagemagick -resize 256x256! $img $tmp_img");
- if ($exec_im){
- return { error => "Unable to resize image" } ;
- }
- return {};
-}
-
-
-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{/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 '/' => sub {
- send_file "index.html";
-};
-get qr{/fonts/([\w\.\-_]+)} => sub {
- my ($filename) = splat;
- send_file sprintf("/fonts/%s", $filename);
-};
-
-post '/img/load' => sub {
- my $texture = params->{texture};
- my $heightmap = params->{heightmap};
- to_json( { texture => $texture, heightmap => $heightmap } );
-
-};
-post 'img/save' => sub {
-};
-dance;