Skip to content

Instantly share code, notes, and snippets.

use Mojolicious::Lite;
use Test::More;
use Test::Mojo;
my $r = app->routes;
$r->any('/l1')->detour( 'Lite' );
$r->any('/l2')->detour( 'Lite' );
$r->any('/f1')->detour( 'Full' );
$r->any('/f2')->detour( 'Full' );
# BEGIN{ $ENV{MOJO_INACTIVITY_TIMEOUT} = 0; }
use Mojolicious::Lite;
package DeepApp;
use Mojolicious::Lite;
get '/test' => sub {
my $c = shift;
$c->render( text => 'OK' );
};
@KES777
KES777 / captures.t
Last active November 2, 2017 11:20
use Mojolicious::Lite;
use Test::More;
use Test::Mojo;
my $deep = Mojolicious->new;
$deep->routes->any('/deep', sub{ shift->render( 'deep' ) } )->name( 'deep' );
$deep->routes->any('/abs', sub{ shift->render( 'abs' ) } );
my $r = app->routes;
# carton snapshot format: version 1.0
DISTRIBUTIONS
Algorithm-C3-0.10
pathname: H/HA/HAARG/Algorithm-C3-0.10.tar.gz
provides:
Algorithm::C3 0.10
requirements:
Carp 0.01
ExtUtils::MakeMaker 0
Test::More 0.47
@KES777
KES777 / gist:451abd9817449d8230de529a32da0e0c
Created June 10, 2017 14:52
unexpected rendering for /2/0
kes@work ~/work/projects/del4/my_app $ script/my_app get /1/0
[Sat Jun 10 17:50:11 2017] [debug] GET "/1/0"
[Sat Jun 10 17:50:11 2017] [debug] Routing to controller "MyApp::Controller::Render" and action "just_render"
[Sat Jun 10 17:50:11 2017] [debug] Rendering template "content_implicit.html.ep"
[Sat Jun 10 17:50:11 2017] [debug] Rendering template "base.html.ep"
[Sat Jun 10 17:50:11 2017] [debug] 200 OK (0.00265s, 377.358/s)
HI2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!--
This file was generated by Devel::NYTProf version 6.02
--><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Language" content="en-us">
<meta name="robots" content="noindex,nofollow">
<title>Profile of Plack/Middleware/Debug/TraceENV.pm</title>
<link rel="stylesheet" type="text/css" href="delete_files/style.css">
<script type="text/javascript" src="delete_files/jquery-min.js"></script>