Frontend to Backend: Everything is on Scala using Play, Scala.js and ScalaCSS

Knoldus

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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s