some documentation additions/fixes

This commit is contained in:
Graham Knop 2010-04-23 19:22:37 -05:00 committed by Graham Knop
parent cb3f83a93e
commit 8cd0f80bd4
2 changed files with 12 additions and 6 deletions

5
README
View file

@ -18,7 +18,10 @@ I'm currently getting 370 requests/second, whereas I'm getting 430/second on the
= ARCHITECTURE =
* The .psgi file gets to set WEBGUI_ROOT and WEBGUI_CONFIG.
* The root level app.psgi file loads all the config files found and
loads the site specific psgi file for each, linking them to the
proper host names.
* The site psgi file uses the WEBGUI_CONFIG environment variable to find the config.
* It instantiates the $wg WebGUI object (one per app).
* $wg creates and stores the WebGUI::Config (one per app)
* $wg creates the $app PSGI app code ref (one per app)

View file

@ -9,7 +9,8 @@ builder {
my $config = WebGUI::Config->new($config_file);
my $psgi = $config->get('psgiFile') || WebGUI::Paths->defaultPSGI;
my $app = do {
$ENV{WEBGUI_CONFIG} = $config_file;
# default psgi file uses environment variable to find config file
local $ENV{WEBGUI_CONFIG} = $config_file;
Plack::Util::load_psgi($psgi);
};
$first_app ||= $app;
@ -17,6 +18,8 @@ builder {
mount "http://$sitename/" => $app;
}
}
# use the first config found as a fallback
mount '/' => $first_app;
};