#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $c = shift;
my $output = qx{echo "hello there from the shell"};
$c->render(template => 'index', text => $output);
};
app->start;
__DATA__
@@ index.html.ep
% layout 'default';
% title 'Welcome';
<h1>Welcome to the Mojolicious real-time web framework!</h1>
<p><$= text ></p>
@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
<head><title><%= title %></title></head>
<body><%= content %></body>
</html>
Comments
0 B
|👍
/👎
0 B
|👍
/👎