Browse Source

add _stash route for debugging

Byron Jones 7 years ago
parent
commit
8cac80302d
1 changed files with 10 additions and 0 deletions
  1. 10 0
      logbot-web

+ 10 - 0
logbot-web

@@ -27,6 +27,7 @@ use LogBot::Web::Stats   ();
 use LogBot::Web::Util qw( channel_from_param date_from_param rewrite_old_urls );
 use Mojo::ByteStream ();
 use Mojo::File       ();
+use Mojo::Util qw( dumper );
 use Mojolicious::Lite qw( app );
 
 # load networks
@@ -156,6 +157,15 @@ get '/contribute.json' => sub {
     );
 };
 
+# debugging
+if (!$is_production) {
+    get '/_stash' => sub {
+        my ($c) = @_;
+        $c->stash(today => $c->stash('today')->ymd());
+        $c->render(text => dumper($c->stash), format => 'txt');
+    };
+}
+
 # /channel => redirect to current date
 get '/#channel' => sub {
     my ($c) = @_;