Catalyst::Controller::Metal - Raw PSGI handling in Catalyst controllers
package MyApp::Controller::Metalic; use parent 'Catalyst::Controller::Metal'; sub call { my($self, $env) = @_; if ($env->{PATH_INFO} =~ m!^/hello!) { return [ 200, [ "Content-Type" => 'text/plain' ], [ "Hello World" ] ]; } else { return [ 404, [], [] ]; } }
Catalyst::Controller::Metal allows you to write a raw PSGI handler in your Catalyst application, inspired by Rails Metal that allows you to write raw Rack applications inside Ruby on Rails.
Rails Metal.
To install Catalyst::Engine::PSGI, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Catalyst::Engine::PSGI
CPAN shell
perl -MCPAN -e shell install Catalyst::Engine::PSGI
For more information on module installation, please visit the detailed CPAN module installation guide.