Skip to content

Commit

Permalink
#140 Allow Cortex to use a custom root context
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Oct 9, 2018
1 parent 2451fa0 commit b20452d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions app/org/thp/cortex/controllers/Default.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.thp.cortex.controllers

import play.api.Configuration
import play.api.mvc.{ AbstractController, Action, AnyContent, ControllerComponents }

import javax.inject.{ Inject, Singleton }

@Singleton
class Default @Inject() (configuration: Configuration, components: ControllerComponents) extends AbstractController(components) {
def home: Action[AnyContent] = Action {
Redirect(configuration.get[String]("play.http.context") + "/index.html")
}
}
2 changes: 1 addition & 1 deletion conf/routes
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# ~~~~


GET / controllers.Default.redirect(to = "/index.html")
GET / org.thp.cortex.controllers.Default.home
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()
Expand Down

0 comments on commit b20452d

Please sign in to comment.