Hyperlink-Redirect/lib/Hyperlink-Redirect.rakumod

19 lines
459 B
Raku
Raw Normal View History

2023-09-23 00:44:32 -04:00
use v6.d;
use Humming-Bird::Core;
2023-09-24 00:45:18 -04:00
use Template6;
2023-09-23 00:44:32 -04:00
# Normally would 'use' local libs here for Controller and Model and
# what not but keeping it simple for now...
2023-09-24 00:52:15 -04:00
# Set things up (config stuff would go here?)
2023-09-24 00:45:18 -04:00
my $templates = Template6.new;
$templates.add-path: 'templates';
2023-09-23 00:44:32 -04:00
# Must set the root path lest yet miss setting $!root
my $router = Router.new(root => '/');
$router.get(-> $request, $response {
2023-09-24 00:45:18 -04:00
$response.html($templates.process: 'index');
2023-09-23 00:44:32 -04:00
});