Skip to content

@j1n3l0 /hello.pl
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
use Mojolicious::Lite;
use Data::Dump;
use JSON;
get '/' => {text => 'Hello World!'};
post '/greet' => sub {
my $self = shift;
my $name = $self->param('name') || 'World';
$self->render( text => "Hello, " . ucfirst $name . "!\n" );
};
put '/person' => sub {
my $self = shift;
my $data = $self->req->body;
dd decode_json $data;
$self->render(json => $data);
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.