Skip to content

Commit

Permalink
PSGI file for the WRE, that also handles the demo system if enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
perlDreamer committed Feb 9, 2012
1 parent 5f4099a commit 9f27f7a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions wre/sbin/wre.psgi
@@ -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;
};

0 comments on commit 9f27f7a

Please sign in to comment.