Skip to content

Commit

Permalink
new resource method to redirect root path to UI
Browse files Browse the repository at this point in the history
formatting

formatting imports
  • Loading branch information
Auden Woolfson authored and auden-woolfson committed Jan 21, 2025
1 parent 84955a8 commit 67c0266
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,16 @@

import javax.annotation.security.PermitAll;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;

import java.io.IOException;
import java.net.URI;

import static com.facebook.airlift.http.client.HttpUriBuilder.uriBuilderFrom;
Expand Down Expand Up @@ -61,6 +64,15 @@ public Response routeQuery(String statement, @Context HttpServletRequest servlet
return Response.temporaryRedirect(statementUri).build();
}

@GET
@Path("/")
public void rootRedirect(@Context HttpServletRequest servletRequest, @Context HttpServletResponse servletResponse)
throws IOException
{
log.info("redirecting to UI");
servletResponse.sendRedirect("ui");
}

private static WebApplicationException badRequest(Response.Status status, String message)
{
throw new WebApplicationException(
Expand Down

0 comments on commit 67c0266

Please sign in to comment.