works
This commit is contained in:
parent
ff35bc2f76
commit
a1c32811f2
2 changed files with 9 additions and 8 deletions
|
@ -4,4 +4,4 @@
|
|||
show_errors: 1
|
||||
public: 'files'
|
||||
# logging to console
|
||||
logger: "console"
|
||||
# logger: "console"
|
||||
|
|
13
test.pl
13
test.pl
|
@ -22,15 +22,16 @@ sub find_tty {
|
|||
|
||||
# do_ajax
|
||||
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 = params;
|
||||
|
||||
my $data = {map {(split /=/, $_)} split /\&/, $json_str};
|
||||
debug "Sending Color";
|
||||
|
||||
send_color($data);
|
||||
send_color(\%data);
|
||||
|
||||
# return RC_OK;
|
||||
};
|
||||
|
@ -53,7 +54,7 @@ any qr{.*} => sub {
|
|||
|
||||
debug 'Serving file '.request->path;
|
||||
|
||||
if (-e $file) {
|
||||
if (-f 'files/'.$file) {
|
||||
return send_file( params->{file} );
|
||||
} else {
|
||||
return send_file( 'index.html' );
|
||||
|
|
Loading…
Add table
Reference in a new issue