#!/usr/bin/perl -- use Mojolicious::Lite; any '/error' => sub { shift()->render_exception }; get '/' => sub { my( $c ) = @_; return $c->render( 'gates', layout => 'green', ## get usersetting... yada yada time => time(), ); }; get '/login' => sub { shift->render('login', time => time(), ) }; post '/login' => sub { my( $c ) = @_; return $c->redirect_to( '/' ); }; get '/userconfig' => sub { shift->render('userconfig', time => time(), ) }; get '/node/:node' => sub { shift->render('node', time => time(), ) }; get '/preview' => sub { shift->render('preview', time => time(), ) }; websocket '/chatterbox' => \&chatterbox; app->secrets([ time().' is now and I got my mojo working']); app->start; __DATA__ @@ bytes64.txt 0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz @@ layouts/default.html.ep <%= title =%> <%= content =%>
Its <%= $time =%> @@ layouts/green.html.ep <%= title =%> <%= content =%> @@ gates.html.ep % title "$time is now at the gates"; Frontpaged nodes go here