|
|
|
|
@ -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; |
|
|
|
|
@ -59,7 +60,7 @@ public class Application {
@@ -59,7 +60,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); |
|
|
|
|
@ -81,7 +82,10 @@ public class Application {
@@ -81,7 +82,10 @@ public class Application {
|
|
|
|
|
new WebHandler().bindPath("/").on(server); |
|
|
|
|
new WikiModule(config).bindPath("/api/wiki").on(server); |
|
|
|
|
new FileModule(config).bindPath("/api/files").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); |
|
|
|
|
|