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/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt | |
| parent | a5f5f2dd0f32d26bd1f7d5ea6445713231497c66 (diff) | |
| download | reddit-lite-6f52bbd15bd7026b99433dfd30f5c74164b36b9d.tar.xz reddit-lite-6f52bbd15bd7026b99433dfd30f5c74164b36b9d.zip | |
Add misc endpoints
Diffstat (limited to 'src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt')
| -rw-r--r-- | src/main/kotlin/io/jamesbarnett/redditlite/controller/MiscController.kt | 29 |
1 files changed, 29 insertions, 0 deletions
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 |