|
|
|
|
@ -3,6 +3,7 @@ package de.srsoftware.umbrella.backend;
@@ -3,6 +3,7 @@ package de.srsoftware.umbrella.backend;
|
|
|
|
|
|
|
|
|
|
import static de.srsoftware.umbrella.core.Constants.*; |
|
|
|
|
import static de.srsoftware.umbrella.core.Util.mapLogLevel; |
|
|
|
|
import static java.lang.System.Logger.Level.ERROR; |
|
|
|
|
import static java.lang.System.Logger.Level.INFO; |
|
|
|
|
|
|
|
|
|
import com.sun.net.httpserver.HttpServer; |
|
|
|
|
@ -58,7 +59,7 @@ public class Application {
@@ -58,7 +59,7 @@ public class Application {
|
|
|
|
|
config.get("umbrella.plantuml").map(Object::toString).map(File::new).filter(File::exists).ifPresent(Util::setPlantUmlJar); |
|
|
|
|
|
|
|
|
|
var server = HttpServer.create(new InetSocketAddress(port), 0); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
new Translations().bindPath("/api/translations").on(server); |
|
|
|
|
new MessageSystem(config); |
|
|
|
|
new UserModule(config).bindPath("/api/user").on(server); |
|
|
|
|
@ -79,7 +80,10 @@ public class Application {
@@ -79,7 +80,10 @@ public class Application {
|
|
|
|
|
new TimeModule(config).bindPath("/api/time").on(server); |
|
|
|
|
new WebHandler().bindPath("/").on(server); |
|
|
|
|
new WikiModule(config).bindPath("/api/wiki").on(server); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
LOG.log(ERROR,"Startup failed",e); |
|
|
|
|
System.exit(-1); |
|
|
|
|
} |
|
|
|
|
server.setExecutor(Executors.newFixedThreadPool(threads)); |
|
|
|
|
server.start(); |
|
|
|
|
LOG.log(INFO,"Started web server at port {0}",port); |
|
|
|
|
|