diff options
| author | James Barnett <noreply@jamesbarnett.xyz> | 2020-04-13 16:19:50 +0100 |
|---|---|---|
| committer | James Barnett <noreply@jamesbarnett.xyz> | 2020-04-13 16:19:50 +0100 |
| commit | 6f52bbd15bd7026b99433dfd30f5c74164b36b9d (patch) | |
| tree | 088b2b811268200af1b098d64b074fd371570b43 /src | |
| parent | a5f5f2dd0f32d26bd1f7d5ea6445713231497c66 (diff) | |
| download | reddit-lite-6f52bbd15bd7026b99433dfd30f5c74164b36b9d.tar.xz reddit-lite-6f52bbd15bd7026b99433dfd30f5c74164b36b9d.zip | |
Add misc endpoints
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt (renamed from src/main/kotlin/io/jamesbarnett/redditlite/controller/LandingPageController.kt) | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/main/kotlin/io/jamesbarnett/redditlite/controller/LandingPageController.kt b/src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt index c2881bd..ac6e745 100644 --- a/src/main/kotlin/io/jamesbarnett/redditlite/controller/LandingPageController.kt +++ b/src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt @@ -2,12 +2,28 @@ 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 LandingPageController { +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 |