|
|
|
|
@@ -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,28 +59,31 @@ 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);
|
|
|
|
|
|
|
|
|
|
new Translations().bindPath("/api/translations").on(server);
|
|
|
|
|
new MessageSystem(config);
|
|
|
|
|
new UserModule(config).bindPath("/api/user").on(server);
|
|
|
|
|
new TagModule(config).bindPath("/api/tags").on(server);
|
|
|
|
|
new BookmarkApi(config).bindPath("/api/bookmark").on(server);
|
|
|
|
|
new CompanyModule(config).bindPath("/api/company").on(server);
|
|
|
|
|
new CompanyLegacy(config).bindPath("/legacy/company").on(server);
|
|
|
|
|
new DocumentApi(config).bindPath("/api/document").on(server);
|
|
|
|
|
new ItemApi(config).bindPath("/api/items").on(server);
|
|
|
|
|
new UserLegacy(config).bindPath("/legacy/user").on(server);
|
|
|
|
|
new NotesLegacy(config).bindPath("/legacy/notes").on(server);
|
|
|
|
|
new MarkdownApi().bindPath("/api/markdown").on(server);
|
|
|
|
|
new NoteModule(config).bindPath("/api/notes").on(server);
|
|
|
|
|
new ProjectModule(config).bindPath("/api/project").on(server);
|
|
|
|
|
new ProjectLegacy(config).bindPath("/legacy/project").on(server);
|
|
|
|
|
new TaskModule(config).bindPath("/api/task").on(server);
|
|
|
|
|
new TaskLegacy().bindPath("/legacy/task").on(server);
|
|
|
|
|
new TimeModule(config).bindPath("/api/time").on(server);
|
|
|
|
|
new WebHandler().bindPath("/").on(server);
|
|
|
|
|
new WikiModule(config).bindPath("/api/wiki").on(server);
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
new Translations().bindPath("/api/translations").on(server);
|
|
|
|
|
new MessageSystem(config);
|
|
|
|
|
new UserModule(config).bindPath("/api/user").on(server);
|
|
|
|
|
new TagModule(config).bindPath("/api/tags").on(server);
|
|
|
|
|
new BookmarkApi(config).bindPath("/api/bookmark").on(server);
|
|
|
|
|
new CompanyModule(config).bindPath("/api/company").on(server);
|
|
|
|
|
new CompanyLegacy(config).bindPath("/legacy/company").on(server);
|
|
|
|
|
new DocumentApi(config).bindPath("/api/document").on(server);
|
|
|
|
|
new ItemApi(config).bindPath("/api/items").on(server);
|
|
|
|
|
new UserLegacy(config).bindPath("/legacy/user").on(server);
|
|
|
|
|
new NotesLegacy(config).bindPath("/legacy/notes").on(server);
|
|
|
|
|
new MarkdownApi().bindPath("/api/markdown").on(server);
|
|
|
|
|
new NoteModule(config).bindPath("/api/notes").on(server);
|
|
|
|
|
new ProjectModule(config).bindPath("/api/project").on(server);
|
|
|
|
|
new ProjectLegacy(config).bindPath("/legacy/project").on(server);
|
|
|
|
|
new TaskModule(config).bindPath("/api/task").on(server);
|
|
|
|
|
new TaskLegacy().bindPath("/legacy/task").on(server);
|
|
|
|
|
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);
|
|
|
|
|
|