Move the status and healthcheck to root level

This commit is contained in:
Shane Kilkelly 2020-06-19 15:50:27 +01:00
parent 8def058d85
commit ed778639a8

View file

@ -119,17 +119,26 @@ public class GitBridgeServer {
) throws ServletException {
HandlerCollection handlers = new HandlerList();
handlers.addHandler(initApiHandler());
handlers.addHandler(initBaseHandler());
handlers.addHandler(initGitHandler(config, repoStore, snapshotApi));
jettyServer.setHandler(handlers);
}
private Handler initBaseHandler() {
ContextHandler base = new ContextHandler();
base.setContextPath("/");
HandlerCollection handlers = new HandlerList();
handlers.addHandler(new StatusHandler(bridge));
handlers.addHandler(new HealthCheckHandler(bridge));
base.setHandler(handlers);
return base;
}
private Handler initApiHandler() {
ContextHandler api = new ContextHandler();
api.setContextPath("/api");
HandlerCollection handlers = new HandlerList();
handlers.addHandler(new StatusHandler(bridge));
handlers.addHandler(new HealthCheckHandler(bridge));
handlers.addHandler(initResourceHandler());
handlers.addHandler(new PostbackHandler(bridge));
handlers.addHandler(new DefaultHandler());