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
<!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> |
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
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 |
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
# 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 |
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
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; |
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
# BEGIN{ $ENV{MOJO_INACTIVITY_TIMEOUT} = 0; } | |
use Mojolicious::Lite; | |
package DeepApp; | |
use Mojolicious::Lite; | |
get '/test' => sub { | |
my $c = shift; | |
$c->render( text => 'OK' ); | |
}; |
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
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' ); |
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
use Mojolicious::Lite; | |
package Lite; | |
use Mojolicious::Lite; | |
get '/bye' => sub{ shift->render( text => 'OK' ) }; | |
package main; |
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
diff --git a/lib/Mojolicious/Lite.pm b/lib/Mojolicious/Lite.pm | |
index cf3cd04..21277fb 100644 | |
--- a/lib/Mojolicious/Lite.pm | |
+++ b/lib/Mojolicious/Lite.pm | |
@@ -46,9 +46,6 @@ sub import { | |
plugin => sub { $app->plugin(@_) }, | |
under => sub { $routes = $root->under(@_) }; | |
- # Make sure there's a default application for testing | |
- Mojo::UserAgent::Server->app($app) unless Mojo::UserAgent::Server->app; |
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
... | |
sub startup { | |
... | |
$app->hook( before_render => sub{ | |
my( $c, $args ) = @_; | |
my $theme = $c->stash->{ theme } // ''; | |
$args->{template} = "$theme/$args->{template}"; | |
# But here we get two problems: |
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
>Rails picks up the expected format from the query parameter format, or if not there from the URL path suffix, or it not there from the Accept header | |
Blog post: https://dzone.com/articles/rest-with-rails-part-2-serving | |
>format query parameter is useful for rendering JSON output from a web browser without | |
special tools to modify the Accept header | |
IBM knowledge base: https://www.ibm.com/support/knowledgecenter/en/SS4GCC_6.1.1/com.ibm.urelease.doc/topics/rest_api_ref_conventions.html | |
>However, if a request uses multiple methods simultaneously, |
OlderNewer