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/LandingPageController.kt | 13 ---------- .../redditlite/controller/MiscController.kt | 29 ++++++++++++++++++++++ 2 files changed, 29 insertions(+), 13 deletions(-) delete mode 100644 src/main/kotlin/io/jamesbarnett/redditlite/controller/LandingPageController.kt create mode 100644 src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/io/jamesbarnett/redditlite/controller/LandingPageController.kt b/src/main/kotlin/io/jamesbarnett/redditlite/controller/LandingPageController.kt deleted file mode 100644 index c2881bd..0000000 --- a/src/main/kotlin/io/jamesbarnett/redditlite/controller/LandingPageController.kt +++ /dev/null @@ -1,13 +0,0 @@ -package io.jamesbarnett.redditlite.controller - -import org.springframework.stereotype.Controller -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.servlet.ModelAndView - -@Controller -class LandingPageController { - @GetMapping("/") - fun renderLandingPage() : ModelAndView { - return ModelAndView("landing") - } -} \ No newline at end of file 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