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) {
|
|
|
|
my $method = $c->req->method;
|
|
|
|
my $string = $tm->test_model($c->param('string'));
|
|
|
|
|
|
|
|
$c->render(method => $method, string => $string);
|
2021-12-04 05:11:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
app->start();
|