Skip to content

Commit 38a3fcf

Browse files
committed
work around PLACK_ENV not being set by MountPSGI
1 parent b0be776 commit 38a3fcf

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/MetaCPAN/API.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ use MetaCPAN::Script::Runner ();
2626
use Search::Elasticsearch ();
2727
use Try::Tiny qw( catch try );
2828

29+
# MountPSGI doesn't set PLACK_ENV, so Plack::Util::load_psgi defaults to development.
30+
# Hack around that until MountPSGI is fixed.
31+
$ENV{PLACK_ENV} ||= $ENV{'MOJO_MODE'} || 'development';
32+
2933
has es => sub {
3034
return Search::Elasticsearch->new(
3135
client => '2_0::Direct',

0 commit comments

Comments
 (0)