aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/WebServer.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/web/WebServer.java')
-rw-r--r--src/org/traccar/web/WebServer.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index 36c43736d..f5a6acdd9 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -59,6 +59,9 @@ public class WebServer {
break;
case "new":
initApi();
+ if (config.getBoolean("web.console")) {
+ initConsole();
+ }
initWebApp();
break;
case "old":
@@ -110,6 +113,13 @@ public class WebServer {
handlers.addHandler(servletHandler);
}
+ private void initConsole() {
+ ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ servletHandler.setContextPath("/console");
+ servletHandler.addServlet(new ServletHolder(new ConsoleServlet()), "/*");
+ handlers.addHandler(servletHandler);
+ }
+
public void start() {
try {
server.start();