Commits

Sam Adams committed 3a579ab

Extract http port from URI

Comments (0)

Files changed (1)

src/main/java/uk/ac/cam/ch/wwmm/quixote/QuixoteWebappLauncher.java

                 getPluginsModule()
         );
 
+        ChempoundConfiguration config = injector.getInstance(ChempoundConfiguration.class);
+        URI uri = config.getBaseUri();
+        int port = uri.getPort() == -1 ? 80 : uri.getPort();
+
         Component component = injector.getInstance(Component.class);
-        component.getServers().add(Protocol.HTTP, 8181)
+        component.getServers().add(Protocol.HTTP, port)
                 .getContext().getParameters().add("maxThreads", "256");
         component.getDefaultHost().attach(injector.getInstance(Application.class));
         component.start();