support path config option

This commit is contained in:
Oliver Gorwits
2013-06-03 19:13:40 +01:00
parent 31ca119f84
commit 3d1185261a
3 changed files with 17 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
* Phone node icon is a little phone handset * Phone node icon is a little phone handset
* User icon color indicates port_control/admin ability * User icon color indicates port_control/admin ability
* Buttons for discover/macsuck/arpnip on device details page * Buttons for discover/macsuck/arpnip on device details page
* Support 'path' config option as alternative to --path /mountpoint
[BUG FIXES] [BUG FIXES]

View File

@@ -34,7 +34,16 @@ set plack_middlewares => [
]; ];
use App::Netdisco::Web; use App::Netdisco::Web;
dance; use Plack::Builder;
my $app = sub {
my $env = shift;
my $request = Dancer::Request->new(env => $env);
Dancer->dance($request);
};
my $path = (setting('path') || '/');
builder { mount $path => $app };
=head1 NAME =head1 NAME

View File

@@ -22,6 +22,11 @@ parameter to the web startup script:
~/bin/netdisco-web --path /netdisco2 ~/bin/netdisco-web --path /netdisco2
Alternatively, can set the C<path> configuration option in your
C<deployment.yml> file:
path: '/netdisco2'
=head1 Behind a Proxy =head1 Behind a Proxy
By default the web application daemon starts listening on port 5000 and goes By default the web application daemon starts listening on port 5000 and goes
@@ -45,7 +50,7 @@ file:
behind_proxy: 1 behind_proxy: 1
To combine this with Non-root Hosting as above, simply change the paths To combine this with Non-root Hosting as above, simply change the paths
referenced in the configuration like so (and use C<--path> option): referenced in the configuration like so (and use Non-root Hosting as above):
ProxyPass /netdisco2 http://localhost:5000/ ProxyPass /netdisco2 http://localhost:5000/
ProxyPassReverse /netdisco2 http://localhost:5000/ ProxyPassReverse /netdisco2 http://localhost:5000/