Skip to content
Snippets Groups Projects
Commit 37d9dc5f authored by Sören Henning's avatar Sören Henning
Browse files

Add basic logging to HTTP bridge

parent 0931dcf1
No related branches found
No related tags found
No related merge requests found
Pipeline #6522 passed
......@@ -2,12 +2,16 @@ package theodolite.commons.httpbridge;
import io.javalin.Javalin;
import java.util.Collection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Implementation of a webserver based on the Javalin framework.
*/
public class JavalinWebServer {
private static final Logger LOGGER = LoggerFactory.getLogger(JavalinWebServer.class);
private static final int HTTP_SUCCESS = 200;
private final Javalin app = Javalin.create();
......@@ -30,7 +34,9 @@ public class JavalinWebServer {
private void configureRoutes(final Collection<Endpoint<?>> endpoints) {
for (final Endpoint<?> endpoint : endpoints) {
this.app.post(endpoint.getPath(), ctx -> {
endpoint.convert(ctx.body());
final String record = ctx.body();
LOGGER.debug("Received record at '{}': {}", ctx.path(), record);
endpoint.convert(record);
ctx.status(HTTP_SUCCESS);
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment