Hyperlink-Redirect/lib/Hyperlink-Redirect.rakumod

19 lines
459 B
Raku
Raw Normal View History

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