From 0cd415a7f348333c2f4c5ad97416989a1458a1de Mon Sep 17 00:00:00 2001 From: To-om Date: Tue, 9 Oct 2018 16:56:53 +0200 Subject: [PATCH] #140 Rename controller --- app/org/thp/cortex/controllers/{Default.scala => Home.scala} | 4 ++-- conf/routes | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename app/org/thp/cortex/controllers/{Default.scala => Home.scala} (63%) diff --git a/app/org/thp/cortex/controllers/Default.scala b/app/org/thp/cortex/controllers/Home.scala similarity index 63% rename from app/org/thp/cortex/controllers/Default.scala rename to app/org/thp/cortex/controllers/Home.scala index 99090f9f4..9f111ece4 100644 --- a/app/org/thp/cortex/controllers/Default.scala +++ b/app/org/thp/cortex/controllers/Home.scala @@ -6,8 +6,8 @@ import play.api.mvc.{ AbstractController, Action, AnyContent, ControllerComponen import javax.inject.{ Inject, Singleton } @Singleton -class Default @Inject() (configuration: Configuration, components: ControllerComponents) extends AbstractController(components) { - def home: Action[AnyContent] = Action { +class Home @Inject() (configuration: Configuration, components: ControllerComponents) extends AbstractController(components) { + def redirect: Action[AnyContent] = Action { Redirect(configuration.get[String]("play.http.context").stripSuffix("/") + "/index.html") } } \ No newline at end of file diff --git a/conf/routes b/conf/routes index 9e3d97be5..4145627fd 100644 --- a/conf/routes +++ b/conf/routes @@ -3,7 +3,7 @@ # ~~~~ -GET / org.thp.cortex.controllers.Default.home +GET / org.thp.cortex.controllers.Home.redirect GET /api/health org.thp.cortex.controllers.StatusCtrl.health GET /api/logout org.thp.cortex.controllers.AuthenticationCtrl.logout() POST /api/login org.thp.cortex.controllers.AuthenticationCtrl.login()