some documentation additions/fixes
This commit is contained in:
parent
cb3f83a93e
commit
8cd0f80bd4
2 changed files with 12 additions and 6 deletions
5
README
5
README
|
|
@ -18,7 +18,10 @@ I'm currently getting 370 requests/second, whereas I'm getting 430/second on the
|
||||||
|
|
||||||
= ARCHITECTURE =
|
= 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).
|
* It instantiates the $wg WebGUI object (one per app).
|
||||||
* $wg creates and stores the WebGUI::Config (one per app)
|
* $wg creates and stores the WebGUI::Config (one per app)
|
||||||
* $wg creates the $app PSGI app code ref (one per app)
|
* $wg creates the $app PSGI app code ref (one per app)
|
||||||
|
|
|
||||||
5
app.psgi
5
app.psgi
|
|
@ -9,7 +9,8 @@ builder {
|
||||||
my $config = WebGUI::Config->new($config_file);
|
my $config = WebGUI::Config->new($config_file);
|
||||||
my $psgi = $config->get('psgiFile') || WebGUI::Paths->defaultPSGI;
|
my $psgi = $config->get('psgiFile') || WebGUI::Paths->defaultPSGI;
|
||||||
my $app = do {
|
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);
|
Plack::Util::load_psgi($psgi);
|
||||||
};
|
};
|
||||||
$first_app ||= $app;
|
$first_app ||= $app;
|
||||||
|
|
@ -17,6 +18,8 @@ builder {
|
||||||
mount "http://$sitename/" => $app;
|
mount "http://$sitename/" => $app;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# use the first config found as a fallback
|
||||||
mount '/' => $first_app;
|
mount '/' => $first_app;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue