Base/lib';
use Yote;
use Yote::Server;
use CGI;
use DateTime;
use Data::Dumper;
use Encode;
use JSON;
use URI::Escape;
sub _log {
my( $msg ) = @_;
open my $out, ">>/opt/yote/log/yote.log";
re_locker;
}
my $cgi = CGI->new;
# check if a file upload
my $json_payload = uri_unescape(scalar($cgi->param('p')));
_log( "IN : '$json_payload'" );
my $uploads = $cgi->param('f');
my( @uploads );
i
e FILE;
}
}
my $out_json;
eval {
$out_json = $main::yote_server->invoke_payload( $json_payload, \@uploads );
};
if( ref $@ eq 'HASH' ) {
$out_json = encode_json( $@ );
undef $@;
} e
w(:common);
use Data::Dumper;
use Text::Xslate qw(mark_raw);
use Encode;
use HTML::Entities;
use JSON;
use URI::Escape;
use Yote::Server;
sub new {
my( $pkg, %options ) = @_;
#
# Setup
sub handle_json_request {
my( $self, $req ) = @_;
my $json_payload = uri_unescape(scalar($req->param('p')));
my $in_json = decode_json( $json_payload );
my( $out_json, @uploads );
$out_json = $self->{server}->invoke_payload( $json_payload, \@uploads );
};
if( $@ ) {
my $err = ref $@ ? $@ : { err => "INTERNAL ERROR" };
$out_json = to_json( $err );
alized';
no warnings 'numeric';
use Lock::Server;
use Yote;
use bytes;
use IO::Socket::SSL;
use JSON;
use Time::HiRes qw(time);
use URI::Escape;
use UUID::Tiny;
use vars qw($VERSION);
$VERSION =
$sock->close;
exit;
}
# data has the input parmas in JSON format.
# POST /
if ( $verb ne 'POST' ) {
$sock->print( "HTTP/1.1 40
p=//;
my $out_json;
eval {
$out_json = $self->invoke_payload( $data );
};
if( ref $@ eq 'HASH' ) {
$out_json = encode_json( $@ );
}