first commit
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/* © SRSoftware 2025 */
|
||||
package de.srsoftware.umbrella.backend;
|
||||
|
||||
import static java.lang.System.Logger.Level.DEBUG;
|
||||
import static java.lang.System.Logger.Level.INFO;
|
||||
|
||||
import com.sun.net.httpserver.HttpServer;
|
||||
import de.srsoftware.tools.ColorLogger;
|
||||
import de.srsoftware.umbrella.translations.Translations;
|
||||
import de.srsoftware.umbrella.web.WebHandler;
|
||||
import java.io.IOException;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
public class Application {
|
||||
private static final System.Logger LOG = System.getLogger("Umbrella");
|
||||
public static void main(String[] args) throws IOException {
|
||||
ColorLogger.setRootLogLevel(DEBUG);
|
||||
LOG.log(INFO, "Starting Umbrella:");
|
||||
var port = 8080;
|
||||
var threads = 16;
|
||||
HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
|
||||
server.setExecutor(Executors.newFixedThreadPool(threads));
|
||||
new WebHandler().bindPath("/").on(server);
|
||||
new Translations().bindPath("/api/translations").on(server);
|
||||
LOG.log(INFO,"Started web server at {0}",port);
|
||||
server.start();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user