• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4251 shaares
 
Filters
5 results tagged psgi

Please add info into DOC how to run PSGI under CGI · Issue #566 · plack/Plack · GitHub

QRCode

Please put this into synopsys of 'plackup' $ SCRIPT_NAME='/' REQUEST_METHOD='GET' SERVER_NAME='www.test' SERVER_PORT='5000' plackup -s CGI t.pl

Also:

https://github.com/plack/Plack/issues/598
https://github.com/plack/Plack/issues/147
https://github.com/plack/Plack/pull/159/files
https://github.com/plack/Plack/pull/217
https://github.com/plack/Plack/pull/235

https://github.com/plack/Plack/issues/566
May 5, 2025 at 11:06:51 AM EDT *
perl plack psgi cgi
FILLER

Perl Advent Calendar 2014 - PSGI, Enabling Modern Web Technology in Perl

QRCode

In recent years we've seen an explosion of powerful web technologies in Perl not at the least due to the creation of the PSGI specification.

Plack provides the Plack::Middleware class that makes the process of modifying the response easier, and along with Plack::Util helps us deal with the slightly more complex cases where there's a callback for a response from our inner class:

Plack::Test

Another great thing about abstracting away the actual webserver that our PSGI application is talking to is that we don't actually have to have a real webserver at the outer layer at all! If we just want to test our application we can do this in process by just sending input to the anonymous subroutine and examining the return values.

https://perladvent.org/2014/2014-12-04.html
June 26, 2023 at 9:59:30 AM EDT *
perl psgi
FILLER

Moving from CGI to PSGI and Starman

QRCode

Moving from an old CGI application to Plack/PSGI in CGI mode and to running it in the Starman application server.

https://perlmaven.com/from-cgi-to-psgi-and-starman
May 8, 2023 at 3:49:54 PM EDT *
perl plack cgi psgi
FILLER

Day 3: Zoopla Theatre: Mark Overmeer - Apache in Pure Perl

QRCode

From its start, Perl comes with most (Unix) core operating system trickery like forks, events and signals. So, you can implement real performing daemons for interesting tasks.

We will get into various features which show how straight-forward it is to implement an Apache-like webserver, with VirtualHosts, proxies, etc.

But we start by discussing many options how to set-up servers: processes, event-loops, and so on... before we reach to HTTP-servers processing requests.

Any::Daemon

  • Use Apache as your front end ~30:00
https://www.youtube.com/watch?v=cOmev2nl_1M
April 17, 2023 at 10:55:19 AM EDT *
perl apache webdesign http psgi
FILLER

Modern Perl CGI | Aristotle [blogs.perl.org]

QRCode

A modernisation of this using Plack is straightforwardly equivalent:

#!/usr/bin/env perl
use strict;
use warnings;
use Plack::Request;
use Encode::Simple;
use JSON::MaybeXS;

my $app = sub {
    my $req = Plack::Request->new($_[0]);
    my $input = eval { decode 'UTF-8', $req->parameters->{'input'} };
    [ 200, [ 'Content-Type', 'application/json; charset=UTF-8' ], [ encode_json { output => uc $input } ] ];
};

This is now a full PSGI app and as such gains all the same additional deployment options of the Mojolicious example. To deploy it as a CGI script you add this line at the bottom:

use Plack::Handler::CGI; Plack::Handler::CGI->new->run($app);

In all it takes about twice as long to load as the CGI.pm example, compared to the Mojolicious example taking about 7× as long. In exchange you get all the benefits of the PSGI ecosystem – without losing any of the strengths of deploying as a CGI script, unlike the Mojolicious example.

http://blogs.perl.org/users/aristotle/2018/11/modern-perl-cgi.html
July 2, 2020 at 10:48:23 AM EDT *
perl cgi plack mojolicious psgi
FILLER
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community