4 # Documentation browser under "/perldoc"
9 use Data::Dump qw(dump);
12 my $json = Mojo::JSON->new;
13 my $client = Mojo::UserAgent->new;
15 post '/collector' => sub {
17 my $data = XMLin( $self->req->body );
20 my $res = $client->post( 'http://localhost:5984/mmonit/' => { 'Content-Type' => 'application/json' } => $json->encode( $data ) )->res->json;
22 warn "# res = ",dump($res);
24 $self->render('index');
33 Welcome to Mojolicious!
35 @@ layouts/default.html.ep
37 <head><title><%= title %></title></head>
38 <body><%= content %></body>