#!/usr/bin/perl -- # Automatically use-s strict/warnings/utf8 and feature :5.10 use Mojolicious::Lite; sub mojo_index { my( $self ) = @_; my $time = time; my @three = ( 1..3 ); return $self->render( title => "Mojo $time", thumbs => \@three ); } ## map paths to subroutines ### #~ route named 'index', render's template index.html.ep if html is accepted get '/' => \&mojo_index => 'index';;; #~ https://localhost:3000/index #~ https://localhost:3000/index.html #~ https://localhost:3000/index.txt get '/index' => sub { shift->render( title => "Mojo \$time" , thumbs => [ 6,6,6] ) }; helper thumbs => sub { [ 9,9,9 ] }; helper thumbstring => sub { join ' ', @{[ 9,9,9 ]} }; # Start the Mojolicious command system _aka_ shagadelic('daemon'); app->start; #~ https://metacpan.org/pod/Mojolicious::Plugin::DefaultHelpers#include __DATA__ @@ thumbs.html.ep I am thumbs.html.ep