Questions tagged [plack]

Plack is a Perl module and toolkit that contains middleware, helpers and adapters to web servers. PSGI is an interface between Perl web applications and web servers.

Plack is a set of tools that contains middleware components, a reference server and utilities for Web application frameworks using the stack.

A little Plack Handbook is available to get started with Plack and PSGI. Also see the Plack Advent Calenda with 24 useful short posts explaining the concept of PSGI and tutorials.

Web site: http://plackperl.org/

102 questions
1
vote
1 answer

Perl Dancer on Apache server using Plack::Runner

I have a Perl Dancer web app which I would like to run on an apache server (on centos 6). I put at the webapp's rootdir a sym link (index.html) to the public/dispatch.cgi script which uses the Pluck::Runner module. The problem is when loading the…
user1380641
  • 81
  • 2
  • 4
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
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
2 answers

Using sessions with perl Dancer/plack/Starman and multiple workers

I'm running a perl Dancer application using Starman via plack (hopefully that is describing things correctly), and mostly this has been a painless experience. I've just recently been trying to get sessions working (really simple stuff - I just want…
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
1 answer

As of 2014, what technology is a good replacement for mod_perl?

I've been using mod_perl for years. I have a few modules that handle Apache requests at early states, basically custom responses based on request headers that alter the normal response from Apache, like custom response codes and things like…
Francisco Zarabozo
  • 3,676
  • 2
  • 28
  • 54
0
votes
2 answers

How do you implement non-blocking responses in a perl plack app?

I'm trying to write a a perl-based webserver using Twiggy::Server (which means a plack app). I want to respond to a request (coming from an ajax call on a webpage) for some data by running some possibly time-consuming subroutine which generates the…
sbs
  • 1,139
  • 3
  • 13
  • 19
0
votes
1 answer

How do you print an environment variable in Perl/Plack

I'm trying to switch out 'Ben' with an environment variable using Perl/Plack. If the environment variable is set (e.g. 'Dave'), then it will print out "Powered by Dave". But it if is not set, it will default to 'Ben'. Currently, the following…
Ben
  • 5,085
  • 9
  • 39
  • 58
0
votes
1 answer

Using Plack app with a reverse proxy - Plack::Middleware::Debug

Edited the question. I have this simple Plack app.psgi: my $app = sub { my $env = shift; return [ 200, ['Content-Type' => 'text/html'], [ "x
Path info:…
clt60
  • 62,119
  • 17
  • 107
  • 194
0
votes
1 answer

using Plack::Middleware::DBIC::QueryLog with Dancer webapp

I am trying to use Plack::Middleware::DBIC::QueryLog inside of a dancer application. The documentation tells me to get the querylog like this: use Plack::Middleware::DBIC::QueryLog; sub get_querylog_from_env { my ($self, $env) = @_; …
Kungi
  • 1,477
  • 1
  • 18
  • 34
0
votes
1 answer

Twiggy 400 Bad Request while serving static file handle

I have a problem that is difficult to reproduce in a smaller test case, but here is the basic description: I'm running Perl's Twiggy web server as root, bound to port 81. I use Plack::App::File->(root => "/my/directory") as the default web…
1 2 3 4 5 6
7