URI;
use AnyEvent::IO qw(aio_load);
use Try::Tiny;
use JSON::XS;
use Plack::MIME;
use MooseX::Types::Path::Class;
our $json = JSON::XS->new->utf8->pretty->canonical;
our @no_cache_header
(is => 'ro', isa => 'Str', required => 1);
has 'json_content' =>
(is => 'ro', isa => 'Ref', required => 0, lazy => 1, builder => '_build_json_content');
has 'params' => (is => 'ro', isa
build_base_url'
);
has 'want_json' => (
is => 'ro',
isa => 'Bool',
required => 1,
lazy => 1,
builder => '_build_want_json'
);
has 'jsonp' => (
is => 'ro',
gs;
use 5.010;
use utf8;
use Moose;
with qw(Async::Microservice);
our $VERSION = '0.03';
has '+jsonp' => (default => '_cb');
use DateTime;
use Time::HiRes qw(time);
use AnyEvent;
use AnyEvent::Fut
me_dt) ];
}
sub POST_datetime {
my ($self, $this_req) = @_;
my $epoch = eval {$this_req->json_content->{epoch}};
if (!defined($epoch)) {
return [
405,
[],
pt: application/json"
curl "http://localhost:8085/v1/epoch" -H "accept: application/json"
curl "http://localhost:8085/v1/datetime?time_zone=local" -H "accept: application/json"
=head1 DESCRI