From 6f52bbd15bd7026b99433dfd30f5c74164b36b9d Mon Sep 17 00:00:00 2001 From: James Barnett Date: Mon, 13 Apr 2020 16:19:50 +0100 Subject: Add misc endpoints --- .../redditlite/controller/MiscController.kt | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt (limited to 'src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt') diff --git a/src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt b/src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt new file mode 100644 index 0000000..ac6e745 --- /dev/null +++ b/src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt @@ -0,0 +1,29 @@ +package io.jamesbarnett.redditlite.controller + +import org.springframework.stereotype.Controller +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.ResponseBody +import org.springframework.web.servlet.ModelAndView + +@Controller +class MiscController { + @GetMapping("/") + fun renderLandingPage() : ModelAndView { + return ModelAndView("landing") + } + + @GetMapping("/healthcheck") + @ResponseBody + fun healthCheck() : String { + return "ok" + } + + @GetMapping("/robots.txt") + @ResponseBody + fun robotsTxt() : String { + return """User-agent: * +Disallow: / +""" + } + +} \ No newline at end of file -- cgit v1.2.3