Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PSGI file for the WRE, that also handles the demo system if enabled.
- Loading branch information
1 parent
5f4099a
commit 9f27f7a
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
=head1 LEGAL | ||
------------------------------------------------------------------- | ||
WebGUI is Copyright 2001-2012 Plain Black Corporation. | ||
------------------------------------------------------------------- | ||
Please read the legal notices (docs/legal.txt) and the license | ||
(docs/license.txt) that came with this distribution before using | ||
this software. | ||
------------------------------------------------------------------- | ||
http://www.plainblack.com info@plainblack.com | ||
------------------------------------------------------------------- | ||
=cut | ||
|
||
use strict; | ||
use Plack::Builder; | ||
use Plack::Util; | ||
use WRE::Config; | ||
|
||
builder { | ||
# use the first config found as a fallback | ||
my $wre_config = WRE::Config->new(); | ||
if ($wre_config->get('demo/enabled')) { | ||
use WRE::WebguiDemo; | ||
my $wre = WRE::WebguiDemo->new(); | ||
mount $wre_config->get('demo/hostname') => $wre; | ||
} | ||
my $webgui = Plack::Util::load_psgi($wre_config->getWebguiRoot('app.psgi')); | ||
mount '/' => $webgui; | ||
}; | ||
|