Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 20f3e7c653
Fetching contributors…

Cannot retrieve contributors at this time

40 lines (29 sloc) 0.721 kB
use strict;
use warnings;
package MyApp::Controller;
use base 'WebNano::Controller';
sub new {
my $class = shift;
my $self = $class->SUPER::new( @_ );
$self->url_map( { 'mapped url' => 'mapped_url' } );
return $self;
}
sub index_action {
my $self = shift;
return $self->render( template => 'index.tt' );
}
sub mapped_url { 'This is the mapped url page' }
sub streaming_action {
my $self = shift;
return sub {
my $respond = shift;
my $writer = $respond->([
200,
[ 'Content-Type' => 'text/plain', ],
]);
$writer->write( "Hello, " );
$writer->write( $self->req->param( 'who' ) );
$writer->close();
}
}
1;
Jump to Line
Something went wrong with that request. Please try again.