Skip to content

Instantly share code, notes, and snippets.

@ryochin
Last active May 20, 2016 07:09
Show Gist options
  • Save ryochin/bd39b9b12df849f100cd to your computer and use it in GitHub Desktop.
Save ryochin/bd39b9b12df849f100cd to your computer and use it in GitHub Desktop.
psgi file for MysqlTool (wip)
# cpanm Plack CGI::Compile CGI::Emulate::PSGI
# vi htdocs/mysqltool.conf
# plackup ./mysqltool.psgi
use strict;
use warnings;
use lib qw(lib);
use CGI::Compile;
use CGI::Emulate::PSGI;
use Plack::Builder;
my $config = "./htdocs/mysqltool.conf";
my $sub = CGI::Compile->compile("./htdocs/index.cgi");
my $app = CGI::Emulate::PSGI->handler( sub {
require $config;
MysqlTool->handler;
} );
builder {
enable 'Static', path => qr{^/(images)/}, root => "./htdocs";
$app;
};
__END__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment