diff --git a/pom.xml b/pom.xml
index bc392c5..d108e88 100644
--- a/pom.xml
+++ b/pom.xml
@@ -7,10 +7,7 @@
dev.relism
Flash
1.0-SNAPSHOT
- pom
-
- flash-bench
-
+ jar
21
@@ -57,6 +54,12 @@
2.0.16
runtime
+
+ org.projectlombok
+ lombok
+ 1.18.42
+ provided
+
diff --git a/src/main/java/dev/relism/HttpServer.java b/src/main/java/dev/relism/HttpServer.java
index 81df8fa..805528e 100644
--- a/src/main/java/dev/relism/HttpServer.java
+++ b/src/main/java/dev/relism/HttpServer.java
@@ -63,12 +63,11 @@ public class HttpServer {
* when the accept loop is running and the server is ready to serve requests.
*/
public CompletableFuture start() {
- Thread.ofVirtual().name("flash-accept-loop").start(this::run);
+ Thread.ofPlatform().name("flash-accept-loop").daemon(false).start(this::run);
return readyFuture;
}
private void run() {
- log.info("Server started on port {}", configuration.getPort());
try (executorService) {
readyFuture.complete(null);
while (!stopped) {
diff --git a/src/main/java/dev/relism/Main.java b/src/main/java/dev/relism/Main.java
index b236418..9e5ac34 100644
--- a/src/main/java/dev/relism/Main.java
+++ b/src/main/java/dev/relism/Main.java
@@ -4,11 +4,15 @@ import dev.relism.http.ContentType;
import dev.relism.models.*;
import dev.relism.routing.Route;
import dev.relism.routing.routers.fastpathrouter.FastPathRouterImpl;
+import lombok.extern.slf4j.Slf4j;
import java.io.IOException;
+@Slf4j
public class Main {
+ private static final int PORT = 8080;
+
/*
@Route(method = "GET", path = "/profile")
public static class ProfileHandler extends RequestHandler {
@@ -21,7 +25,7 @@ public class Main {
public static void main(String[] args) throws IOException {
HttpServerConfiguration config = HttpServerConfiguration.builder()
- .port(8080)
+ .port(PORT)
.host("localhost")
.build();
@@ -36,6 +40,6 @@ public class Main {
throw new RuntimeException(req.getQueryParam("test"));
});
- server.start().thenRun(() -> System.out.println("Flash running on :" + config.getPort()));
+ server.start().thenRun(() -> log.info("Server started on port: " + PORT));
}
}