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
3
votes
3 answers

Where can I find application runtime errors using Nginx, Starman, Plack and Catalyst?

I have managed successfully to server my Catalyst app on my development machine using Plack + Starman, using a daemon script I based on one I found in Dave Rolsky's Silki distribution. I then set up nginx to reverse proxy to my Starman server, and…
cubabit
  • 2,527
  • 3
  • 21
  • 34
3
votes
1 answer

Accessing __DATA__ from super class

I have a super class called Response : package Response; use strict; use warnings; use HTML::Template; sub response { my ( $class, $request ) = @_; return $request->new_response( $class->status, $class->headers, $class->body ); } sub…
Fred Sullet
  • 371
  • 1
  • 6
  • 18
3
votes
1 answer

twiggy plack anyevent how to handle requests while the main loop is blocking?

I'm very new to Plack, Twiggy and AnyEvent and having a problem. I have client facing application servers that fire requests to a backend game server. The game servers do a couple of things. 1. they do things to objects when a request arrives from…
mark
  • 1,769
  • 3
  • 19
  • 38
3
votes
2 answers

Log output missing when using Plack::Middleware compatible exceptions in Catalyst

For my Catalyst project I am using an own Moose based exception type, that is compatible with Catalyst and my command line applications. To provide clients of my Catalyst REST interface with error messages, I implemented a code subroutine that is…
user3112922
3
votes
1 answer

deploy multiple instances of mojolicious app

I have developed a Mojolicious app on Windows XP, strawberry perl 5.14.2 and Mojolicious version 3.84. For high performance i want to create multiple instances of this app and listening on different ports but same computer. To achieve that i made…
Nishant Bhardwaj
  • 638
  • 1
  • 6
  • 13
3
votes
1 answer

Plack::Builder - last line isn't using mount - error message

Having the next simple Plack app: use strict; use warnings; use Plack::Builder; my $app = sub { return [ 200, [ 'Content-Type' => 'text/plain' ], [ 'Hello World' ] ]; }; builder { foreach my $act ( qw( /some/aa /another/bb / ) ) { …
kobame
  • 5,766
  • 3
  • 31
  • 62
3
votes
1 answer

How do I get my Poet web site running under Apache2?

If I currently have a Poet web site running under the standalone plackup server (via run.pl), how do I configure Apache2 to host this Poet web site? Searches for "+apache2 +poet" retrieve plenty of results about poets using Apache2 (to publish their…
ManicDee
  • 732
  • 6
  • 16
3
votes
1 answer

How to serve static files (images etc.) for a PSGI / Plack web app (in Perl)?

How to serve static files (images, javascript, stylesheets) for a PSGI / Plack based web app? The answer would probably depend on what web server one uses, be it CGI, FastCGI, mod_psgi, or pure-Perl like Starman. I have heard that using…
Jakub Narębski
  • 309,089
  • 65
  • 217
  • 230
2
votes
1 answer

PSGI application with Apache2 using Plack::Handler::Apache2 results in 'not found'

first time poster, long time lurker here. Im using a tiny PSGI application in plackup, but id like to switch to Apache2 for subdomains. I run the application with 'plackup /home/ath88/work/kolle/script/dir.psgi -port 80'. It runs perfectly on…
ath88
  • 296
  • 1
  • 11
2
votes
1 answer

plackup access log - locale and open pragma - encoding problem

My locale setting is utf8, so, when starting plackup the date strings are localized too. Therefore I getting console access-log like the following: $ plackup a.psgi HTTP::Server::PSGI: Accepting connections at http://0:5000/ 127.0.0.1 - -…
clt60
  • 62,119
  • 17
  • 107
  • 194
2
votes
1 answer

How to pass a command line option in Perl Dancer App executed by plackup

If I want to start a Perl Dancer app, I have to run the following command: perl app.psgi If I want to pass an option to the application and access it inside the script from @ARGV, I can do it like this: perl app.psgi --option1 --option2 I can run…
mirchev1977
  • 167
  • 12
2
votes
1 answer

How to intercept reply in Plack/Apache

Given the following handler (straight from https://metacpan.org/pod/Plack::Handler::Apache2) package My::ModPerl::Handler; use Plack::Handler::Apache2; sub get_app { # magic! } sub handler { my $r = shift; # Apache2::RequestRec my $app…
az5112
  • 590
  • 2
  • 11
2
votes
1 answer

How do I write a Plack middleware that runs after the HTTP response is sent to the client?

My Plack web service logs via a TCP connection to fluentD, and I'd like to execute my logging code after I've sent the response back to the client. This would reduce response time (assume this is a high request volume service where such a…
Aaron
  • 412
  • 1
  • 7
  • 11
2
votes
0 answers

"Cronjob" inside a PSGI script

I have a PSGI script using plack builder which is being executed using uwgsi by having multiple processes spawned. I have to refresh every minute an internal hash by using a database call. Is it somehow possible, independent from outside…
2
votes
0 answers

Share and modify variables in PSGI between processes

We have a PSGI script using UWSGI with multi processes and threads, looking for a fast solution to share editable hashes between these processed and threads. I did tests by using in-memory storage like Cache::Memcached::Fast and Redis. There are…