Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > a66278b0225b22e2bd3fba784b298883 > files > 47

perl-Text-Xslate-2.1.0-2.mga4.x86_64.rpm

#!perl
use strict;
use warnings;

use Amon2::Lite;

get '/' => sub {
    my ($c) = @_;
    $c->render('index.tt');
};
get '/hello' => sub {
    my ($c) = @_;
    $c->render('index.tt', { name => 'Amon2' });
};

sub res_404 {
    my($c) = @_;
    use Data::Dumper;
    die Dumper($c);
}

__PACKAGE__->to_app();

__DATA__

@@ index.tt
<!doctype html>
<html>
    <body><h1>Hello, [% name // 'Xslate' %] world!</body>
</html>