25 lines
451 B
Perl
25 lines
451 B
Perl
# Automatically enables "strict", "warnings", "utf8" and Perl 5.16 features
|
|
use Mojolicious::Lite -signatures;
|
|
use Data::Printer;
|
|
|
|
# Route with placeholder
|
|
get '/:foo' => sub ($c) {
|
|
my $foo = $c->param('foo');
|
|
$c->render(text => "Hello");
|
|
};
|
|
|
|
get '/' => sub ($c) {
|
|
p $c->tx->req;
|
|
$c->render(text => "Hello");
|
|
|
|
};
|
|
|
|
post '/*' => sub ($c) {
|
|
p $c->tx;
|
|
|
|
$c->render(text => "Helloo.");
|
|
|
|
};
|
|
|
|
# Start the Mojolicious command system
|
|
app->start; |