Add basic-site

This commit is contained in:
swagg boi 2023-11-09 21:37:39 -05:00
parent 1eb445d433
commit b0398537f6
5 changed files with 35 additions and 1 deletions

View file

@ -6,6 +6,10 @@ jesus fuck what is this
How are recursive function calls impacted by dynamic variables? How are recursive function calls impacted by dynamic variables?
## multipart-form.raku ## multipart-form
Process uploaded files with Humming-Bird Process uploaded files with Humming-Bird
## basic-site
Serve a simple static site with Humming-Bird

20
basic-site/basic-site.raku Executable file
View file

@ -0,0 +1,20 @@
#!/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;

View file

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
<title>{{title}}</title>
</head>
<body>
<h1>{{title}}</h1>
<p>We will we will... RAKU!!</p>
</body>
</html>