diff --git a/README.md b/README.md index 2839b4c..9ce722d 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ jesus fuck what is this How are recursive function calls impacted by dynamic variables? -## multipart-form.raku +## multipart-form Process uploaded files with Humming-Bird + +## basic-site + +Serve a simple static site with Humming-Bird diff --git a/basic-site/basic-site.raku b/basic-site/basic-site.raku new file mode 100755 index 0000000..e223f8d --- /dev/null +++ b/basic-site/basic-site.raku @@ -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; diff --git a/basic-site/templates/index.mustache b/basic-site/templates/index.mustache new file mode 100644 index 0000000..0fd71c9 --- /dev/null +++ b/basic-site/templates/index.mustache @@ -0,0 +1,10 @@ + + + + {{title}} + + +

{{title}}

+

We will we will... RAKU!!

+ + diff --git a/multipart-form.raku b/multipart-form/multipart-form.raku similarity index 100% rename from multipart-form.raku rename to multipart-form/multipart-form.raku diff --git a/templates/index.mustache b/multipart-form/templates/index.mustache similarity index 100% rename from templates/index.mustache rename to multipart-form/templates/index.mustache