Tatsuhiko Miyagawa and Johan Vromans point out a very nice approach to creating a Plack stand-alone executable on p5p:
% cat > app.cgi package main; my $app = sub { return [ 200, [ "Content-Type", "text/html" ], [ "Hello" ] ]; }; Plack::Handler::CGI->new->run($app); % cat `perldoc -l Plack::Handler::CGI` app.cgi > app_bundled.cgi
... or, creating a Mojolicious::Lite app:
$ cat > myapp.pl use Mojolicious::Lite; get '/' => sub { my $self = shift; $self->render(text => "Hi"); }; app->start;
The myapp.pl can work as a CGI, but also as a PSGI handler if you deploy to platforms that only supports PSGI apps and *not* CGI, such as Heroku, DotCloud and Stackato.
In reply to Re: Remove CGI.pm from Perl Core? (Plack / PSGI Stand-Alone)
by Corion
in thread Remove CGI.pm from Perl Core?
by rpnoble419
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |