[Dancer-users] running a route from another route within Dancer

Puneet Kishor punk.kish at gmail.com
Tue Oct 25 15:40:02 CEST 2011


Is something like the following possible (see the line marked />+/)? Or, even advisable?

	get '/foo.:format' => sub {
		my $a = param 'a';
		my $b = param 'b';
		
		my $res = query_db($a, $b);
		return to_json $res;
	}
	
	get '/bar.:format' => sub {
		my $a = param 'a';
		my $b = param 'b';
		
	>>>>>>	my $res_foo = <somehow call /foo.json?a=$a&b=$b>;
		my $res = do_something($res_foo);
		return to_json $res;
	}

--
Puneet Kishor


More information about the Dancer-users mailing list