Skip to content
Permalink
Browse files

PSGI file for the WRE, that also handles the demo system if enabled.

  • Loading branch information...
perlDreamer committed Feb 9, 2012
1 parent 5f4099a commit 9f27f7aa6ea8e2fda49120831a1d1dac47c6cf79
Showing with 32 additions and 0 deletions.
  1. +32 −0 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.
You can’t perform that action at this time.