All Downloads are FREE. Search and download functionalities are using the official Maven repository.

info.unterrainer.commons.httpserver.handlers.HealthHandler Maven / Gradle / Ivy

There is a newer version: 0.3.14
Show newest version
package info.unterrainer.commons.httpserver.handlers;

import info.unterrainer.commons.httpserver.enums.Attribute;
import info.unterrainer.commons.httpserver.jsons.MessageJson;
import io.javalin.http.Context;
import io.javalin.http.Handler;
import lombok.RequiredArgsConstructor;

@RequiredArgsConstructor
public class HealthHandler implements Handler {

	private MessageJson message;

	@Override
	public void handle(final Context ctx) throws Exception {
		if (message == null)
			message = MessageJson.builder().message("healthy").build();
		ctx.attribute(Attribute.RESPONSE_OBJECT, message);
		ctx.attribute(Attribute.RESPONSE_STATUS, 200);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy