diff --git a/app/controllers/HomeController.scala b/app/controllers/HomeController.scala new file mode 100644 index 0000000..58c5a34 --- /dev/null +++ b/app/controllers/HomeController.scala @@ -0,0 +1,24 @@ +package controllers + +import play.api.mvc._ + +import javax.inject._ + +/** + * This controller creates an `Action` to handle HTTP requests to the + * application's home page. + */ +@Singleton +class HomeController @Inject()(val controllerComponents: ControllerComponents) extends BaseController { + + /** + * Create an Action to render an HTML page. + * + * The configuration in the `routes` file means that this method + * will be called when the application receives a `GET` request with + * a path of `/`. + */ + def index(): Action[AnyContent] = Action { implicit request: Request[AnyContent] => + Ok(views.html.index()) + } +} \ No newline at end of file diff --git a/app/views/index.scala.html b/app/views/index.scala.html new file mode 100644 index 0000000..afd0746 --- /dev/null +++ b/app/views/index.scala.html @@ -0,0 +1,5 @@ +@() + +@main("Welcome to Play") { +

Welcome to Play

+} diff --git a/conf/routes b/conf/routes index ec37fe3..4bd70ea 100644 --- a/conf/routes +++ b/conf/routes @@ -1,3 +1,4 @@ +GET / controllers.HomeController.index() GET /game controllers.GameController.index() GET /bricks controllers.GameController.getBricks()