diff --git a/build.sbt b/build.sbt index b1946c4..2d99d91 100644 --- a/build.sbt +++ b/build.sbt @@ -28,10 +28,11 @@ lazy val commonSettings = Seq( lazy val knockoutwhist = project.in(file("knockoutwhist")) .settings( - commonSettings + commonSettings, + mainClass := Some("de.knockoutwhist.KnockOutWhist") ) -lazy val knockoutwhistWeb = project.in(file("knockoutwhist-web")) +lazy val knockoutwhistweb = project.in(file("knockoutwhistweb")) .enablePlugins(PlayScala) .dependsOn(knockoutwhist % "compile->compile;test->test") .settings( @@ -40,7 +41,7 @@ lazy val knockoutwhistWeb = project.in(file("knockoutwhist-web")) ) lazy val root = (project in file(".")) - .aggregate(knockoutwhist, knockoutwhistWeb) + .aggregate(knockoutwhist, knockoutwhistweb) .settings( - name := "KnockOutWhistRoot" + name := "KnockOutWhistWeb" ) diff --git a/knockoutwhist b/knockoutwhist deleted file mode 120000 index 22713e0..0000000 --- a/knockoutwhist +++ /dev/null @@ -1 +0,0 @@ -/home/janis/Workspaces/IntelliJ/knockoutwhist \ No newline at end of file diff --git a/knockoutwhist-web/app/controllers/HomeController.scala b/knockoutwhistweb/app/controllers/HomeController.scala similarity index 65% rename from knockoutwhist-web/app/controllers/HomeController.scala rename to knockoutwhistweb/app/controllers/HomeController.scala index 1bed9e2..883c557 100644 --- a/knockoutwhist-web/app/controllers/HomeController.scala +++ b/knockoutwhistweb/app/controllers/HomeController.scala @@ -12,6 +12,8 @@ import de.knockoutwhist.KnockOutWhist @Singleton class HomeController @Inject()(val controllerComponents: ControllerComponents) extends BaseController { + private var initial = false + /** * Create an Action to render an HTML page. * @@ -19,7 +21,14 @@ class HomeController @Inject()(val controllerComponents: ControllerComponents) e * will be called when the application receives a `GET` request with * a path of `/`. */ - def index() = Action { implicit request: Request[AnyContent] => - Ok(views.html.main.render("KnockoutWhist", views.html.index.render())) + def index() = { + if (!initial) { + initial = true + KnockOutWhist.main(new Array[String](_length = 0)) + } + Action { implicit request: Request[AnyContent] => { + Ok(views.html.main.render("KnockoutWhist", views.html.index.apply())) + } + } } -} +} \ No newline at end of file diff --git a/knockoutwhist-web/app/views/index.scala.html b/knockoutwhistweb/app/views/index.scala.html similarity index 100% rename from knockoutwhist-web/app/views/index.scala.html rename to knockoutwhistweb/app/views/index.scala.html diff --git a/knockoutwhist-web/app/views/main.scala.html b/knockoutwhistweb/app/views/main.scala.html similarity index 100% rename from knockoutwhist-web/app/views/main.scala.html rename to knockoutwhistweb/app/views/main.scala.html diff --git a/knockoutwhist-web/conf/application.conf b/knockoutwhistweb/conf/application.conf similarity index 100% rename from knockoutwhist-web/conf/application.conf rename to knockoutwhistweb/conf/application.conf diff --git a/knockoutwhist-web/conf/logback.xml b/knockoutwhistweb/conf/logback.xml similarity index 100% rename from knockoutwhist-web/conf/logback.xml rename to knockoutwhistweb/conf/logback.xml diff --git a/knockoutwhist-web/conf/messages b/knockoutwhistweb/conf/messages similarity index 100% rename from knockoutwhist-web/conf/messages rename to knockoutwhistweb/conf/messages diff --git a/knockoutwhist-web/conf/routes b/knockoutwhistweb/conf/routes similarity index 100% rename from knockoutwhist-web/conf/routes rename to knockoutwhistweb/conf/routes diff --git a/knockoutwhist-web/public/images/favicon.png b/knockoutwhistweb/public/images/favicon.png similarity index 100% rename from knockoutwhist-web/public/images/favicon.png rename to knockoutwhistweb/public/images/favicon.png diff --git a/knockoutwhist-web/public/javascripts/main.js b/knockoutwhistweb/public/javascripts/main.js similarity index 100% rename from knockoutwhist-web/public/javascripts/main.js rename to knockoutwhistweb/public/javascripts/main.js diff --git a/knockoutwhist-web/public/stylesheets/main.css b/knockoutwhistweb/public/stylesheets/main.css similarity index 100% rename from knockoutwhist-web/public/stylesheets/main.css rename to knockoutwhistweb/public/stylesheets/main.css diff --git a/knockoutwhist-web/test/controllers/HomeControllerSpec.scala b/knockoutwhistweb/test/controllers/HomeControllerSpec.scala similarity index 100% rename from knockoutwhist-web/test/controllers/HomeControllerSpec.scala rename to knockoutwhistweb/test/controllers/HomeControllerSpec.scala