This commit is contained in:
Ryan Voots 2013-08-18 13:26:25 -07:00
parent ff35bc2f76
commit a1c32811f2
2 changed files with 9 additions and 8 deletions

View file

@ -4,4 +4,4 @@
show_errors: 1 show_errors: 1
public: 'files' public: 'files'
# logging to console # logging to console
logger: "console" # logger: "console"

15
test.pl
View file

@ -22,15 +22,16 @@ sub find_tty {
# do_ajax # do_ajax
any '/ajax' => sub { any '/ajax' => sub {
my ($request, $response) = @_; # my $json_str = $request->content();
my $json_str = $request->content();
print "D: $json_str\n"; # print "D: $json_str\n";
my $data = {map {(split /=/, $_)} split /\&/, $json_str}; # my $data = {map {(split /=/, $_)} split /\&/, $json_str};
my %data = params;
send_color($data); debug "Sending Color";
send_color(\%data);
# return RC_OK; # return RC_OK;
}; };
@ -53,7 +54,7 @@ any qr{.*} => sub {
debug 'Serving file '.request->path; debug 'Serving file '.request->path;
if (-e $file) { if (-f 'files/'.$file) {
return send_file( params->{file} ); return send_file( params->{file} );
} else { } else {
return send_file( 'index.html' ); return send_file( 'index.html' );