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
2
votes
1 answer

understanding this Plack implementation

I am looking at a strange implementation of a web service using Plack, and I can't quite understand how all the pieces come together (a coworker copied and modified it from a tutorial, but he can't find the tutorial any more). First of all, this…
Stephen
  • 8,508
  • 12
  • 56
  • 96
2
votes
3 answers

How do I start plack application on boot

Does anyone know how to start a plack application on boot. The os is raspbian(raspberry pi). I think i have run it as a normal user(pi). That's how i start it manually. I have tried adding something like this to rc.local but without success su pi -c…
tejas
  • 1,795
  • 1
  • 16
  • 34
2
votes
0 answers

How do i use Plack Authentication with Session middleware?

I am having my own written middleware called Authentication and session where Authentication middleware generates the session key and save the session information in cookie upon successful authentication. Now using above cookie the Session…
CodeQuestor
  • 881
  • 1
  • 11
  • 25
2
votes
2 answers

How to get information about itself in app.psgi?

Having any PSGI based app, e.g. like the following app.psgi snippet use 5.016; use warnings; use Data::Dumper; #WHAT TO DO HERE to get the $port? my $port = $ENV{SERVER_PORT} // "undefined"; print STDERR "my port is: $port\n"; #says…
kobame
  • 5,766
  • 3
  • 31
  • 62
2
votes
2 answers

How do you use Plack::Middleware::Session with a Starman Server?

I have a Starman based server - #!/usr/bin/perl use strict; use warnings; use Data::Printer; use Plack::Builder; my $app = sub { my $env = shift; my $session = $env->{'psgix.session'}; # Print environment variables p($env); …
CodeQuestor
  • 881
  • 1
  • 11
  • 25
2
votes
1 answer

How can I mount a mojolicious app with PSGI?

I would like to mount a Mojolicious app with others using plackup or starman. The docs here here describe how to use a single application, but not how I could have a Mojolicious app coexist with other Catalyst- or Dancer-based ones behind the same…
simone
  • 4,667
  • 4
  • 25
  • 47
2
votes
1 answer

How do I discover on what server the app.psgi process is running?

Is there a way to discover on what server app.psgi is running? For example, I am looking for some idea for how to solve the next code fragment from app.psgi: #app.psgi use Modern::Perl; use Plack::Builder; my $app = sub { ... }; my $server =…
clt60
  • 62,119
  • 17
  • 107
  • 194
2
votes
1 answer

Starman eat all the memory with Dancer REST api

I have developed a RESTful application with perl framework Dancer. This application needs almost 1 GB in memory and it takes 30 seconds to be loaded. This application works pretty well in a local test with ./bin/app.pl for a single user, then I try…
Sak
  • 31
  • 4
2
votes
1 answer

Perl supervisor plackup starman perlbrew

I would like to know if there is a Perl tool like supervisord to manage processes. http://supervisord.org/ I have seen a Perl program called Supervisor, but I don't know if it is as good as the Python one: https://metacpan.org/pod/Supervisor I want…
Hobbestigrou
  • 1,777
  • 1
  • 13
  • 16
2
votes
1 answer

How to use Plack::Middleware::CSRFBlock with Dancer?

I want to protect all forms from CSRF with Dancer. I tried using Plack::Middleware::CSRFBlock, but the error said "CSRFBlock needs Session.". Even if I use Plack::Session, forms didn't have a hidden input field that contains one time token. Are…
ernix
  • 3,442
  • 1
  • 17
  • 23
1
vote
1 answer

Calling 'confess' under Plack/Starman

I have a Plack/Starman application running with TryCatch statements that call 'confess' from the Carp module. However I notice that the confess output is not printing to STDOUT. I've tried routing STDERR output to STDOUT '2>&1', but still don't see…
MadHacker
  • 608
  • 5
  • 18
1
vote
1 answer

How to add edit-layer as Plack-middleware?

I have an idea to add a edit-layer to website as a Plack middleware. Explanation: let's say, we create a website, based on some framework and templates and CSS (requesting it like /some/page). Now we could create a middleware so that every request…
w.k
  • 8,218
  • 4
  • 32
  • 55
1
vote
1 answer

How can Plack debug a request?

I am debugging an HTTP Client with Plack, where the plack server listens on port 80 and the client sends request. How can I see the client request using Plack? I am trying to do something like this: my $app = sub { my $self = shift; [200,…
dave
  • 867
  • 1
  • 5
  • 11
1
vote
1 answer

How to change Plack Session's name?

I have two applications on the same domain, but they are both creating a plack_session every time the user logs in. It happens because application A overwrites application B's plack session. It's a complex process to remove one of them and make…
brainoverflow
  • 691
  • 2
  • 9
  • 22
1
vote
1 answer

How can Plack applications log to multiple loggers?

Plack Middleware is very useful, for instance to configure logging targets independent of the application. But I have not found a method to use multiple loggers at the same time: my $app = MyApp->new(); builder { enable 'ConsoleLogger'; # show in…
Jakob
  • 3,570
  • 3
  • 36
  • 49