Add demo server plugin

Change-Id: Ic2fbe8920397aeab176aba57b22d061f6697ff32
diff --git a/Changes b/Changes
index f521e17..4b16d51 100755
--- a/Changes
+++ b/Changes
@@ -35,6 +35,7 @@
         - Fix blind header titles.
         - Turn "upgradeTo" into an object prototype.
         - Fix QueryParam response to work with Chrome (#149).
+        - Added DemoServer plugin.
 
 0.42 2021-06-18
         - Added GitHub based CI for perl.
diff --git a/lib/Kalamar/Plugin/DemoServer.pm b/lib/Kalamar/Plugin/DemoServer.pm
new file mode 100644
index 0000000..b925463
--- /dev/null
+++ b/lib/Kalamar/Plugin/DemoServer.pm
@@ -0,0 +1,22 @@
+package Kalamar::Plugin::DemoServer;
+use Mojo::Base 'Mojolicious::Plugin';
+
+sub register {
+  my ($plugin, $mojo) = @_;
+
+  $mojo->log->warn('THIS IS A DEMO SERVER!','NEVER USE IN PRODUCTION!');
+
+  my $demo_dir = $mojo->home->child('dev', 'demo');
+
+  $mojo->routes->get('/demo/:file', [format => ['html','js']])->to(
+    cb => sub {
+      my $c = shift;
+      return $c->reply->file(
+        $demo_dir->child($c->stash('file') . '.' . $c->stash('format'))
+      );
+    }
+  );
+};
+
+
+1;
diff --git a/t/plugin/demo_server.t b/t/plugin/demo_server.t
new file mode 100644
index 0000000..1b2b524
--- /dev/null
+++ b/t/plugin/demo_server.t
@@ -0,0 +1,25 @@
+use Mojo::Base -strict;
+use Test::More;
+use Test::Mojo;
+
+# Test the documentation
+my $t = Test::Mojo->new('Kalamar' => {
+  Kalamar => {
+    plugins => ['DemoServer']
+  }
+});
+
+$t->get_ok('/demo/all.html')
+  ->status_is(200)
+  ->content_type_is('text/html;charset=UTF-8')
+  ->text_is('title', 'Complete Demo')
+  ;
+
+$t->get_ok('/demo/alldemo.js')
+  ->status_is(200)
+  ->content_type_is('application/javascript')
+  ->content_like(qr!'app/en'!)
+  ;
+
+done_testing;
+__END__