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
1
vote
0 answers

How to get Mason dhandler component name for query?

Before handling a query, I'm trying to figure out if some component can actually handle it; I'm trying to use interp->comp_exists but it does not return a dhandler component for the given query. Is there some way to fetch such component?
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
1
vote
1 answer

How to set Perl Dancer environment with uWSGI (to be used with nginx)

I'm attempting to start a Perl Dancer app in a production environment. I'm invoking uWSGI as follows: uwsgi --socket 127.0.0.1:3031 --psgi ./bin/app.pl and while the app loads and runs, it is laden with errors because no environment gets set at all…
yahermann
  • 1,539
  • 1
  • 12
  • 33
1
vote
1 answer

Mounting PSGI app by regex - different paths -> one app

Looking for a way, how to run the same PSGI $app for multiple requests what aren't defined by the mount prefix. How to mount in such screnario? E.g. let say i have in my app.psgi use Plack::Builder; my $defaultapp = sub { ... }; my $someapp = sub {…
kobame
  • 5,766
  • 3
  • 31
  • 62
1
vote
1 answer

deploying cgi to psgi converted application in apache

#!C:/perl/bin/perl.exe use CGI; my $q = CGI->new; print $q->header('text/plain'), "Hello ", $q->param('name'); #CONVERTED PSGI PAGE #!C:/perl/bin/perl.exe use CGI::PSGI; my $app = sub { my $env = shift; my $q =…
1
vote
0 answers

Reload-safe development environment with Websockets, Perl, Twiggy and Catalyst

I'm developing a PSGI app in Catalyst that uses WebSockets for communication between the front- and back-end. Basically what we do, is as soon as the user session is authenticated, we open a websocket to the back-end, load the JS app on the client…
RandomAndy
  • 324
  • 1
  • 9
1
vote
1 answer

Perl's BEGIN blocks in app.psgi

I understand that the BEGIN is executed before the main program. The questions are: what is the main program when talking about an PGSI application - or better when will be executed the BEGIN block in an PGSI app? It is different for plackup or…
clt60
  • 62,119
  • 17
  • 107
  • 194
1
vote
0 answers

PSGI and WSDL - How "public" that WSDL?

My problem is that I have these two files: 1.- marcas.psgi #!/usr/bin/perl use strict; use warnings; use WWW::Curl::easy; use WWW::Curl; use Data::Dumper qw(Dumper); $Data::Dumper::Sortkeys = 1; use Plack::Request; my $app = sub { ###…
Sebosin
  • 167
  • 6
  • 16
1
vote
0 answers

Plack does not come back from Catalyst

I have an app that may choose to serve a file from disk - or go to Catalyst and generate a dynamic one. Something like this (inside call()): if (-f $path){ my $app = Plack::App::File->new(file => $path)->to_app; #serve published page …
KateYoak
  • 1,591
  • 3
  • 18
  • 34
1
vote
1 answer

Plack::Builder get post

Is there a way to specify in the builder section of a particular method (GET or POST), but not both at once? My example of builder section. my $main_app=builder { mount "/" => builder{$app;}; }; It handles get and post requests, how can I…
justnoxx
  • 135
  • 1
  • 11
0
votes
1 answer

Dynamic package loading under plackup with Starman

I am running a web app under plackup with starman and trying to dynamically load and instantiate packages based on user requests. I am using 'require $packageName;' to load the package where $packageName contains the name of the package, the names…
MadHacker
  • 608
  • 5
  • 18
0
votes
2 answers

calling subroutines in perl plack return nothing

I am new to perl plack/psgi. I want to access a subroutine within the perl plack/psgi loop, but it looks like if the subroutine is not being executed. Every parent variable like $number should being passed automatically like when writing a regular…
JOhnlw009a
  • 1,012
  • 1
  • 7
  • 12
0
votes
1 answer

Why does "HTML::Mason::PSGIHandler" not work with 'Plack::Middleware::Debug::Parameters'?

Everything is OK, until you post values and get: [uwsgi-perl error] Bad Content-Length: maybe client disconnect? (45 bytes remaining) at /home/user/perl5/lib/perl5/Plack/Middleware/Debug/Parameters.pm line 20. The skeleton of the application is: use…
Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
0
votes
1 answer

Intermittent errors with new code release to existing Mojolicious app

I'm having a problem with an existing Mojolicous app. I have added some new routes, views, controllers, and models, and am returning database results to view using Rose::DB::Object ORM. I updated the production version today with code that had been…
dudeman
  • 503
  • 3
  • 11
0
votes
0 answers

nginx redirect and basic auth woes

I have a service (Plack) which listens on http://myhost.com:5000 I want to password protect access to it with Basic Auth When I set a server directive in the nginx conf file I get a conflict with Plack (can't bind to 0.0.0.0:5000 because it is use…
user3687001
  • 335
  • 1
  • 3
  • 12
0
votes
0 answers

Passing variables in PSGI

I've got a CGI script that I want to convert to PSGI. This is the result: use CGI::Emulate::PSGI; use strict; use warnings; use CGI qw(:cgi-lib :standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); my $q = new CGI; my @keys =…
TheChosenOne
  • 705
  • 1
  • 6
  • 14