aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/web')
-rw-r--r--src/org/traccar/web/WebServer.java34
1 files changed, 12 insertions, 22 deletions
diff --git a/src/org/traccar/web/WebServer.java b/src/org/traccar/web/WebServer.java
index ad40e246f..82a695e96 100644
--- a/src/org/traccar/web/WebServer.java
+++ b/src/org/traccar/web/WebServer.java
@@ -35,9 +35,6 @@ import org.traccar.api.resource.SessionResource;
import org.traccar.api.resource.UserResource;
import org.traccar.helper.Log;
-/**
- * Integrated HTTP server
- */
public class WebServer {
private Server server;
@@ -63,21 +60,19 @@ public class WebServer {
initServer();
switch (config.getString("web.type", "new")) {
case "api":
- initApi();
- break;
- case "new":
- initApi();
- if (config.getBoolean("web.console")) {
- initConsole();
- }
- initWebApp();
+ initOldApi();
break;
case "old":
- initApi();
+ initOldApi();
+ initRestApi();
initOldWebApp();
break;
default:
- Log.error("Unsupported web application type: " + config.getString("web.type"));
+ initRestApi();
+ if (config.getBoolean("web.console")) {
+ initConsole();
+ }
+ initWebApp();
break;
}
server.setHandler(handlers);
@@ -102,15 +97,10 @@ public class WebServer {
Log.warning(error);
}
- WebAppContext webapp = new WebAppContext();
- webapp.setContextPath("/");
- webapp.setWar(config.getString("web.application"));
- handlers.addHandler(webapp);
- }
-
- private void initApi() {
- initOldApi();
- initRestApi();
+ WebAppContext app = new WebAppContext();
+ app.setContextPath("/");
+ app.setWar(config.getString("web.application"));
+ handlers.addHandler(app);
}
@Deprecated