Skip to content

Instantly share code, notes, and snippets.

@moritz
Created March 19, 2011 19:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moritz/877731 to your computer and use it in GitHub Desktop.
Save moritz/877731 to your computer and use it in GitHub Desktop.
myappl.pl
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
die "foo";
$self->render('index');
};
app->start unless caller;
__DATA__
@@ index.html.ep
% title 'Welcome';
<p>You will never see this.</p>
$ perl myapp.pl daemon --reload
Sat Mar 19 20:23:42 2011 info Mojo::Server::Daemon:316 [14979]: Server listening (http://*:3000)
Server available at http://*:3000.
Sat Mar 19 20:23:44 2011 debug Mojolicious:22 [14979]: Your secret passphrase needs to be changed!!!
Sat Mar 19 20:23:44 2011 debug Mojolicious::Plugin::RequestTimer:24 [14979]: GET / (curl/7.21.0 (x86_64-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.5).
Sat Mar 19 20:23:44 2011 debug Mojolicious::Routes:418 [14979]: Dispatching callback.
Sat Mar 19 20:23:44 2011 error Mojolicious::Routes:434 [14979]: foo at myapp.pl line 7.
Sat Mar 19 20:23:44 2011 error Mojolicious::Controller:318 [14979]: foo at myapp.pl line 7.
Sat Mar 19 20:23:44 2011 debug Mojolicious::Plugin::EplRenderer:61 [14979]: Template "exception.development.html.ep" not found.
Sat Mar 19 20:23:44 2011 debug Mojolicious::Plugin::EplRenderer:61 [14979]: Template "exception.html.ep" not found.
Sat Mar 19 20:23:44 2011 error Mojolicious::Controller:318 [14979]: Can't use string ("") as a subroutine ref while "strict refs" in use at /home/moritz/perl5//perls/perl-5.12.2/lib/site_perl/5.12.2/Mojolicious/Plugin/TagHelpers.pm line 200.
195:
196: # CDATA
197: my $cb;
198: if (ref $_[-1] && ref $_[-1] eq 'CODE') {
199: my $old = pop;
200: $cb = sub { "/*<![CDATA[*/\n" . $old->() . "\n/*]]>*/" }
201: }
202:
203: # Path
204: my $href;
205: $href = shift if @_ % 2;
Sat Mar 19 20:23:44 2011 debug Mojolicious::Plugin::RequestTimer:48 [14979]: 500 Internal Server Error (0.053648s, 18.640/s).
Sat Mar 19 20:23:44 2011 error Mojolicious::Controller:318 [14979]: Can't use string ("") as a subroutine ref while "strict refs" in use at /home/moritz/perl5//perls/perl-5.12.2/lib/site_perl/5.12.2/Mojolicious/Plugin/TagHelpers.pm line 200.
195:
196: # CDATA
197: my $cb;
198: if (ref $_[-1] && ref $_[-1] eq 'CODE') {
199: my $old = pop;
200: $cb = sub { "/*<![CDATA[*/\n" . $old->() . "\n/*]]>*/" }
201: }
202:
203: # Path
204: my $href;
205: $href = shift if @_ % 2;
$ curl http://127.0.0.1:3000/ -o -
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment