Skip to content

Commit 9f27f7a

Browse files
committedFeb 9, 2012
PSGI file for the WRE, that also handles the demo system if enabled.
1 parent 5f4099a commit 9f27f7a

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
 

‎wre/sbin/wre.psgi

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
=head1 LEGAL
3+
4+
-------------------------------------------------------------------
5+
WebGUI is Copyright 2001-2012 Plain Black Corporation.
6+
-------------------------------------------------------------------
7+
Please read the legal notices (docs/legal.txt) and the license
8+
(docs/license.txt) that came with this distribution before using
9+
this software.
10+
-------------------------------------------------------------------
11+
http://www.plainblack.com info@plainblack.com
12+
-------------------------------------------------------------------
13+
14+
=cut
15+
16+
use strict;
17+
use Plack::Builder;
18+
use Plack::Util;
19+
use WRE::Config;
20+
21+
builder {
22+
# use the first config found as a fallback
23+
my $wre_config = WRE::Config->new();
24+
if ($wre_config->get('demo/enabled')) {
25+
use WRE::WebguiDemo;
26+
my $wre = WRE::WebguiDemo->new();
27+
mount $wre_config->get('demo/hostname') => $wre;
28+
}
29+
my $webgui = Plack::Util::load_psgi($wre_config->getWebguiRoot('app.psgi'));
30+
mount '/' => $webgui;
31+
};
32+

0 commit comments

Comments
 (0)