diff --git a/src/main/java/org/gcube/gcat/rest/ApiDocs.java b/src/main/java/org/gcube/gcat/rest/ApiDocs.java index 926b8d5..7f7701d 100644 --- a/src/main/java/org/gcube/gcat/rest/ApiDocs.java +++ b/src/main/java/org/gcube/gcat/rest/ApiDocs.java @@ -17,24 +17,24 @@ import org.slf4j.LoggerFactory; /** * @author Luca Frosini (ISTI-CNR) */ -//@Path("api-docs") +@Path("api-docs") public class ApiDocs { private static Logger logger = LoggerFactory.getLogger(ApiDocs.class); @GET -// @Path("{any: .*}") + @Path("{any: .*}") public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException { logger.trace("Called method to redirect to api-docs/index.html"); String pathInfo = req.getPathInfo(); try { - if (pathInfo.endsWith("/api-docs")) { + if (pathInfo.endsWith("api-docs")) { pathInfo += "/index.html"; } - if (pathInfo.endsWith("/api-docs/")) { + if (pathInfo.endsWith("api-docs/")) { pathInfo += "index.html"; } diff --git a/src/main/java/org/gcube/gcat/rest/Docs.java b/src/main/java/org/gcube/gcat/rest/Docs.java index fe6782d..8d6ca86 100644 --- a/src/main/java/org/gcube/gcat/rest/Docs.java +++ b/src/main/java/org/gcube/gcat/rest/Docs.java @@ -17,7 +17,7 @@ import org.slf4j.LoggerFactory; /** * @author Luca Frosini (ISTI-CNR) */ -//@Path("docs") +@Path("docs") public class Docs { private static Logger logger = LoggerFactory.getLogger(Docs.class); @@ -25,18 +25,18 @@ public class Docs { @GET -// @Path("{any: .*}") + @Path("{any: .*}") public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException { logger.trace("Called method to redirect to docs/index.html"); String pathInfo = req.getPathInfo(); try { - if (pathInfo.endsWith("/docs")) { + if (pathInfo.endsWith("docs")) { pathInfo += "/index.html"; } - if (pathInfo.endsWith("/docs/")) { + if (pathInfo.endsWith("docs/")) { pathInfo += "index.html"; }