21 lines
406 B
Raku
Executable file
21 lines
406 B
Raku
Executable file
#!/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;
|