Created
August 23, 2012 03:29
-
-
Save zpmorgan/3431889 to your computer and use it in GitHub Desktop.
mojo url fail?
This file contains 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 $self = shift; | |
$self->render('index', url => $self->req->url); | |
}; | |
app->start; | |
__DATA__ | |
@@ index.html.ep | |
% layout 'default'; | |
% title 'Welcome'; | |
Welcome to the Mojolicious real-time web framework! | |
<br /> port: <%= stash('url')->port %> | |
<br /> host: <%= stash('url')->host %> | |
<br /> path: <%= stash('url')->path %> | |
<br /> base: <%= stash('url')->base %> | |
@@ layouts/default.html.ep | |
<!DOCTYPE html> | |
<html> | |
<head><title><%= title %></title></head> | |
<body><%= content %></body> | |
</html> |
This file contains 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
Welcome to the Mojolicious real-time web framework! | |
port: | |
host: | |
path: / | |
base: http://127.0.0.1:3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment