com.gs.api.accelrx.monitor.handler.AboutHandler Maven / Gradle / Ivy
The newest version!
package com.gs.api.accelrx.monitor.handler;
import io.vertx.core.Handler;
import io.vertx.core.json.JsonObject;
import io.vertx.rxjava3.core.http.HttpHeaders;
import io.vertx.rxjava3.ext.web.RoutingContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AboutHandler implements Handler {
private static final Logger log = LoggerFactory.getLogger(AboutHandler.class);
private final AboutView view;
public AboutHandler(AboutView view) {
this.view = view;
}
public static AboutHandler create(AboutView view) {
return new AboutHandler(view);
}
@Override
public void handle(RoutingContext ctx) {
ctx.response()
.putHeader(HttpHeaders.CONTENT_TYPE, "application/json")
.end(new JsonObject().put("response", view.toJson()).encode());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy