Skip to content

Commit

Permalink
Another plack runner sample
Browse files Browse the repository at this point in the history
  • Loading branch information
hkoba committed Dec 5, 2023
1 parent a2d4c43 commit 11f6c0e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions samples/runplack-env-dev.cgi
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/perl -w
use strict;
use warnings FATAL => qw/all/;
use File::Spec;

my $app_root;

use File::Basename ();
use Umask::Local;
BEGIN {
($app_root = File::Spec->rel2abs(__FILE__)) =~ s,/cgi-bin/[^/]+$,,;
my $error_log = "$app_root/var/log/error_log";
if (-e $error_log) {
my $umask_local = Umask::Local->new(0007);
open STDERR, '>>', $error_log or die $!;
}
}

use Plack::Runner;
Plack::Runner->new(env => 'development', app => "$app_root/app.psgi")->run();

0 comments on commit 11f6c0e

Please sign in to comment.