guestbook-ng/guestbook-ng.pl

24 lines
442 B
Perl
Raw Normal View History

2021-12-04 05:11:37 +00:00
#!/usr/bin/env perl
# Dec 2021
# Daniel Bowling <swaggboi@slackware.uk>
use Mojolicious::Lite -signatures;
2021-12-04 07:26:25 +00:00
use lib 'lib';
use GuestbookNg::Model::Test;
my $tm = GuestbookNg::Model::Test->new();
2021-12-04 05:11:37 +00:00
get '/' => sub ($c) {
2021-12-04 07:26:25 +00:00
$c->render()
} => 'index';
any '/test' => sub ($c) {
2021-12-04 18:28:07 +00:00
my $method = $c->req->method();
2021-12-04 07:26:25 +00:00
my $string = $tm->test_model($c->param('string'));
$c->render(method => $method, string => $string);
2021-12-04 05:11:37 +00:00
};
app->start();