de.otto.edison.status.controller.InternalController Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edison-status Show documentation
Show all versions of edison-status Show documentation
Status library of the edison-microservice project.
package de.otto.edison.status.controller;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Redirect requests to /internal to /internal/status.
*
* This can be disabled by setting edison.status.redirect-internal.enabled=false in your application.properties.
*
* Created by guido on 05.02.16.
*/
@Controller
@ConditionalOnProperty(name = "edison.status.redirect-internal.enabled", havingValue = "true", matchIfMissing = true)
public class InternalController {
@Value("${server.context-path}")
private String serverContextPath;
@RequestMapping(value = "/internal")
public void redirectToStatus(final HttpServletResponse response) throws IOException {
response.sendRedirect(serverContextPath + "/internal/status");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy