Created
September 13, 2018 08:11
-
-
Save marcusramberg/852427a7581e1945397318d17042db15 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
# Documentation browser under "/perldoc" | |
plugin 'PODRenderer'; | |
get '/' => sub { | |
my $c = shift; | |
$c->render(template => 'index'); | |
}; | |
app->start; | |
__DATA__ | |
@@ index.html.ep | |
% layout 'default'; | |
% title 'Welcome'; | |
<h1>Welcome to the Mojolicious real-time web framework!</h1> | |
To learn more, you can browse through the documentation | |
<%= link_to 'here' => '/perldoc' %>. | |
@@ layouts/default.html.ep | |
<!DOCTYPE html> | |
% my $t="DUDE"; | |
<html> | |
<head><title><%= title %></title></head> | |
<body><%= $t %>, <%= content %></body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment