Questions tagged [psgi]

PSGI (Perl Web Server Gateway Interface) is an interface between web servers and Perl-based web applications and frameworks that allows writing portable applications that can be run as standalone servers or using CGI, FastCGI, mod_perl, etc.

PSGI (Perl Web Server Gateway Interface) is an interface between web servers and Perl-based web applications and frameworks that allows writing portable applications that can be run as standalone servers or using CGI, FastCGI, mod_perl, etc. (from: Wikipedia)

This is an example PSGI application:

my $app = sub {
    return [200, ['Content-Type' => 'text/plain'], ["Hello, World!\n"]];
}

PSGI is inspired by Python's (Web Server Gateway Interface), Ruby's and JSGI for JavaScript.

80 questions
34
votes
1 answer

Plack::App::CGIBin via Apache and mod_fastcgi - CGI script not found

I'm trying to get Plack::App::CGIBin to work using Apache2 and FastCGI on FreeBSD 8.2. The eventual aim is to be able to use this setup to serve a whole bunch of legacy CGI scripts via Plack, in order to take advantage of its middleware…
user2889711
20
votes
3 answers

PSGI: What is it and what's the fuss about?

I have been trying to decide if my web project is a candidate for implementation using PSGI, but I don't really see what good it would do for my application at this stage. I don't really understand all the fuss. To me PSGI seems like a framework…
Joakim
  • 510
  • 4
  • 10
18
votes
2 answers

How do I make a PSGI program do costly initialisation only once per process, not per thread?

cross-post: http://perlmonks.org/?node_id=1191821 Consider app.psgi: #!perl use 5.024; use strictures; use Time::HiRes qw(sleep); sub mock_connect { my $how_long_it_takes = 3 + rand; sleep $how_long_it_takes; return…
daxim
  • 39,270
  • 4
  • 65
  • 132
15
votes
3 answers

Deploying Perl Application

What are the best practices for deploying a Perl application? Assume that you are deploying onto a vanilla box with little CPAN module installation. What are the ideal build, deploy methods? Module::Build, ExtUtils::MakeMaker, other? I am looking…
MadHacker
  • 608
  • 5
  • 18
11
votes
2 answers

Plack & taint mode

Is it recommended developing Plack applications (middlewares) with perl's taint mode? If yes, how to start plackup and/or Starman in tainted mode? In the simple CGI script that was easily done with the shebang line. Will perl -T…
kobame
  • 5,766
  • 3
  • 31
  • 62
9
votes
2 answers

Multi-site aware PSGI application development

The Plack::Builder allows mount multiple hosts, e.g. something as the following snippet: my @sites = load_site_names(); my $apps; for my $site (@sites) { $apps->{$site} = Some::PsgiFramework::MyApp->new( config => get_config($site) ); } use…
kobame
  • 5,766
  • 3
  • 31
  • 62
9
votes
3 answers

Sending an unbuffered response in Plack

I'm working in a section of a Perl module that creates a large CSV response. The server runs on Plack, on which I'm far from expert. Currently I'm using something like this to send the response: $res->content_type('text/csv'); my $body =…
Francisco Zarabozo
  • 3,676
  • 2
  • 28
  • 54
9
votes
1 answer

Is it possible to enforce a max upload size in Plack::Middleware without reading the entire body of the request?

I've just converted a PageKit (mod_perl) application to Plack. This means that I now need some way to enforce the POST_MAX/MAX_BODY that Apache2::Request would have previously handled. The easiest way to do this would probably be just to put nginx…
oalders
  • 5,239
  • 2
  • 23
  • 34
9
votes
2 answers

Why is Test::WWW::Mechanize::PSGI using a port?

I have some code that looks like this: use SomeApp; use Test::WWW::Mechanize::PSGI; my $mech =…
Ovid
  • 11,580
  • 9
  • 46
  • 76
9
votes
3 answers

Authentication and/or HTTPS with Plack/PSGI/Poet application

I need to build a simple web-application. I decided to do it with Poet (Mason2), which uses Plack. The application should be allowed to use only by authenticated users, so I need build some login/password functionality. There already is a Plack…
kobame
  • 5,766
  • 3
  • 31
  • 62
8
votes
1 answer

PSGI logging (Perl)

Despite rather scant and unclear documentation and an effective How-To for beginners, I have grown to like PSGI and am currently using it in one of my applications. What I would like to know is how do I manage logging across a multi-node…
MadHacker
  • 608
  • 5
  • 18
8
votes
2 answers

Are there any modern (Moose/PSGI) web frameworks other than Catalyst?

Are there any Perl web-development frameworks other than Catalyst that are: written with Moose natively written for PSGI (not with some PSGI-emulation) Unicode ready/safe - so Perl 5.10+ small, extensible and nice or is Catalyst the only guy in…
cajwine
  • 3,100
  • 1
  • 20
  • 41
8
votes
1 answer

How can I test a Dancer application with Test::WWW::Mechanize::PSGI?

I'm not sure on the right way to set up the script app for www mechanize. I did try at least one alternate that works, however I'm trying to pass in configuration with the test so I can make logging quieter with the test suite. #!/usr/bin/perl use…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
8
votes
1 answer

Catalyst event loops only reaching a single client at a time

I'm working on a Catalyst/psgi application that would make great use of asychronous streaming, however beyond a simple timer (like here: http://www.catalystframework.org/calendar/2013/13), I'm a little stumped on how to implement more "global"…
Ryan
  • 672
  • 1
  • 6
  • 16
7
votes
2 answers

Multilingual PSGI-web deployment

I plan develop one web application with PSGI/Plack. (probaly with Dancer, but not decided yet). The applicatiion should be utf8, multilingual (with Locale::Maketext) and (ofc) will contain some statical pages in the given language. My idea is deploy…
clt60
  • 62,119
  • 17
  • 107
  • 194
1
2 3 4 5 6