In my previous post, I tried to create a pure front-end application using Scala.js and ScalaCSS. So that we can build our front-end also in a typesafe way. But there was no server interaction.
This time I have tried to make server interaction using play framework. Since this application is about Weather Information System, so I am hitting a third party api to get weather information. I have taken help from play-with-scalajs-example to integrate scala.js with play.
Here is a sample of build.sbt:
lazy val server = (project in file("server")).settings( scalaVersion := scalaV, cpdSettings, scalaJSProjects := clients, pipelineStages := Seq(scalaJSProd, gzip), resolvers += "scalaz-bintray" at "https://dl.bintray.com/scalaz/releases", scalacOptions ++= Seq("-deprecation", "-Xlint","-feature"), libraryDependencies ++= Seq( "com.vmunier" %%% "play-scalajs-scripts" % "0.3.0", "org.scalaj" % "scalaj-http_2.11" % "2.3.0" ) ).enablePlugins(PlayScala). aggregate(clients.map(projectToRef): _*). dependsOn(sharedJvm) lazy val client = (project in file("client")).settings( scalaVersion := scalaV, cpdSettings, persistLauncher := true, persistLauncher in Test := false, scalacOptions…
View original post 160 more words