21 lines
406 B
Raku
21 lines
406 B
Raku
|
#!/usr/bin/env raku
|
||
|
|
||
|
use v6.d;
|
||
|
use Humming-Bird::Core;
|
||
|
use Humming-Bird::Middleware;
|
||
|
use Humming-Bird::Advice;
|
||
|
use Template::Mustache;
|
||
|
|
||
|
middleware &middleware-logger;
|
||
|
advice &advice-logger;
|
||
|
|
||
|
my $template = Template::Mustache.new: :from<./templates>;
|
||
|
|
||
|
get '/', -> $request, $response {
|
||
|
my Str %stash = title => 'Hello, web!';
|
||
|
|
||
|
$response.html($template.render: 'index', %stash);
|
||
|
};
|
||
|
|
||
|
listen 3000;
|