(add) Feature to change root path if needed

This commit is contained in:
Ricardo Salinas 2022-03-06 00:27:10 +11:00
parent a765f728f1
commit 16642aa2ef
No known key found for this signature in database
GPG Key ID: A1E9C3231CD66A18
1 changed files with 2 additions and 1 deletions

View File

@ -947,6 +947,7 @@ public class DynmapCore implements DynmapCommonAPI {
}
webhostname = configuration.getString("webserver-bindaddress", ip);
webport = configuration.getInteger("webserver-port", 8123);
webroot = configuration.getString("webserver-root", "/");
int maxconnections = configuration.getInteger("max-sessions", 30);
if(maxconnections < 2) maxconnections = 2;
@ -1023,7 +1024,7 @@ public class DynmapCore implements DynmapCommonAPI {
FilterHandler fh = new FilterHandler(router, filters);
ContextHandler contextHandler = new ContextHandler();
contextHandler.setContextPath("/");
contextHandler.setContextPath(webroot);
contextHandler.setHandler(fh);
HandlerList hlist = new HandlerList();
hlist.setHandlers(new org.eclipse.jetty.server.Handler[] { new SessionHandler(), contextHandler });