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.java13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index 146dee613..0f9bf8181 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -61,6 +61,9 @@ public class WebServer {
break;
case "new":
initApi();
+ if (config.getBoolean("web.console")) {
+ initConsole();
+ }
initWebApp();
break;
case "old":
@@ -118,12 +121,10 @@ public class WebServer {
handlers.addHandler(servletHandler);
}
- private void initRestApi() {
- ResourceConfig resourceConfig = new ResourceConfig();
- resourceConfig.packages("org.traccar.api");
- ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
- ServletHolder servletHolder = new ServletHolder(new ServletContainer(resourceConfig));
- servletHandler.addServlet(servletHolder, "/rest/*");
+ private void initConsole() {
+ ServletContextHandler servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ servletHandler.setContextPath("/console");
+ servletHandler.addServlet(new ServletHolder(new ConsoleServlet()), "/*");
handlers.addHandler(servletHandler);
}