Add a index page
[nethack-naodash.git] / app.psgi
... / ...
CommitLineData
1#!/usr/bin/perl
2use 5.014000;
3use warnings;
4
5use App::Web::NAOdash;
6use File::Slurp;
7use Plack::Builder;
8
9my $index = read_file 'web/index.html';
10
11builder {
12 mount '/dash/' => App::Web::NAOdash->new->to_app;
13 mount '/json/' => App::Web::NAOdash->new(json => 1)->to_app;
14 mount '/ok' => sub { [200, [], []] };
15 mount '/' => sub {
16 [200, [
17 'Cache-Control' => 'max-age=86400',
18 'Content-Type' => "text/html; charset=utf-8",
19 'Content-Length' => length $index,
20 ], [$index]]
21 };
22}
This page took 0.008402 seconds and 4 git commands to generate.