Package com.endurancetrio.app.common.web
Class RobotsTxtController
java.lang.Object
com.endurancetrio.app.common.web.RobotsTxtController
The
RobotsTxtController serves the /robots.txt endpoint.
The content is rendered from the templates/robots.txt template so that the Sitemap directive uses
the configured app.site-url at runtime. The template is processed by a dedicated SpringTemplateEngine
configured with an .txt suffix and TEXT template mode. The engine is created in the constructor rather
than as a Spring bean so that the autoconfigured Thymeleaf engine (which uses the .html suffix for HTML
views) is left untouched.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the robots.txt content with theSitemapdirective pointing to the configured site URL.
-
Constructor Details
-
RobotsTxtController
-
-
Method Details
-
generateRobotsTxt
@GetMapping(value="/robots.txt", produces="text/plain") @ResponseBody public String generateRobotsTxt()Returns the robots.txt content with theSitemapdirective pointing to the configured site URL.- Returns:
- the rendered robots.txt content
-