Amon2::Plugin::Web::Text - provides render_text method
use Amon2::Lite;
__PACKAGE__->load_plugins('Web::Text');
get '/' => sub {
my $c = shift;
return $c->render_text('hello, world.');
};
get '/not-found' => sub {
my $c = shift;
return $c->render_text( 404 => "Not found");
};
__PACKAGE__->to_app;
Amon2::Plugin::Web::Text provides render_text method to your Amon2 app.
Generate text/plain response. If you specify two arguments, then first is status code, second string. If you specify just one argument, then status code is assumed to be 200.
Copyright (C) Shoichi Kaji.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Shoichi Kaji [email protected]