Created by
Brian Medley
| #!/usr/bin/env perl
use Mojolicious::Lite;
my $config = plugin 'Config';
get '/' => sub {
my $c = shift;
$c->render(template => 'index', from_config => $config->{joy});
};
app->start;
__DATA__
@@ index.html.ep
% layout 'default';
% title 'Welcome';
Welcome to the Mojolicious real-time web framework!
<%= stash('from_config') %>
@@ layouts/default.html.ep
<!DOCTYPE html>
<html>
<head><title><%= title %></title></head>
<body><%= content %></body>
</html>
[bpm@Orfgum] c:~/playground>
[bpm@Orfgum] c:~/playground>cat config.conf
{
joy => '12345',
};
[bpm@Orfgum] c:~/playground>
|