Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

enable catalyst debug when running with plackup

  • Loading branch information...
commit c8976c8c38be9439d8cfbe5a6d7981a8bfe9d01f 1 parent 820f6b0
@monken monken authored
Showing with 19 additions and 8 deletions.
  1. +2 −2 README.pod
  2. +17 −6 app.psgi
View
4 README.pod
@@ -10,7 +10,7 @@ Install the project dependencies:
Start server on port 5000
- $ starman
+ $ plackup
The backend defaults to C<api.metacpan.org>. Running a local API server is optional and not required to hack on the front-end.
The address to the API user can be changed in the metacpan_web.conf file.
@@ -20,7 +20,7 @@ Ideally you would create a new file called C<metacpan_web_local.conf> that conta
which will be loaded on top of the existing config file.
- $ plackup -s Standalone -p 5001 -r
+ $ plackup -p 5001 -r
This will use the API server at C<localhost:5000> and sets the port of the front-end to 5001.
The process will watch changes in the C</lib> directory.
View
23 app.psgi
@@ -1,8 +1,17 @@
package MetaCPAN::Web;
# ABSTRACT: Modern front-end for MetaCPAN
+
use strict;
use warnings;
+
+BEGIN {
+ if ( $ENV{PLACK_ENV} eq 'development' ) {
+ $ENV{PLACK_SERVER} = 'Standalone';
+ $ENV{METACPAN_WEB_DEBUG} = 1;
+ }
+}
+
use FindBin;
use lib "$FindBin::RealBin/lib";
use MetaCPAN::Web;
@@ -17,21 +26,23 @@ MetaCPAN::Web->setup_engine('PSGI');
my $app = Plack::App::URLMap->new;
$app->map( '/static/' => Plack::App::File->new( root => 'root/static' ) );
-$app->map( '/favicon.ico' => Plack::App::File->new( file => 'root/static/icons/favicon.ico' ) );
+$app->map( '/favicon.ico' =>
+ Plack::App::File->new( file => 'root/static/icons/favicon.ico' ) );
$app->map( '/' => sub { MetaCPAN::Web->run(@_) } );
$app = Plack::Middleware::Runtime->wrap($app);
-$app = Plack::Middleware::Assets->wrap( $app, files => [<root/static/css/*.css>] );
+$app = Plack::Middleware::Assets->wrap( $app,
+ files => [<root/static/css/*.css>] );
$app = Plack::Middleware::Assets->wrap(
$app,
files => [
- map { "root/static/js/$_.js" }
- qw(jquery.min jquery.tablesorter jquery.cookie jquery.relatize_date jquery.ajaxQueue jquery.autocomplete.pack shCore shBrushPerl cpan)
+ map {"root/static/js/$_.js"}
+ qw(jquery.min jquery.tablesorter jquery.cookie jquery.relatize_date jquery.ajaxQueue jquery.autocomplete.pack shCore shBrushPerl cpan)
],
minify => 0,
);
$app = Plack::Middleware::ReverseProxy->wrap($app);
-Plack::Middleware::Session::Cookie->wrap($app, session_key => 'metacpan');
+Plack::Middleware::Session::Cookie->wrap( $app, session_key => 'metacpan' );
-# ABSTRACT: A Front End for MetaCPAN
+# ABSTRACT: A Front End for MetaCPAN
Please sign in to comment.
Something went wrong with that request. Please try again.