HomeController.scala 612 B

123456789101112131415161718192021222324
  1. package controllers
  2. import javax.inject._
  3. import play.api._
  4. import play.api.mvc._
  5. /**
  6. * This controller creates an `Action` to handle HTTP requests to the
  7. * application's home page.
  8. */
  9. @Singleton
  10. class HomeController @Inject()(cc: ControllerComponents) extends AbstractController(cc) {
  11. /**
  12. * Create an Action to render an HTML page.
  13. *
  14. * The configuration in the `routes` file means that this method
  15. * will be called when the application receives a `GET` request with
  16. * a path of `/`.
  17. */
  18. def index() = Action { implicit request: Request[AnyContent] =>
  19. Ok(views.html.index())
  20. }
  21. }