diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-11-10 20:49:32 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-11-10 20:49:32 -0800 |
commit | 916476a310661a0b81011e0af429f356d5cd36e7 (patch) | |
tree | ae0515e87b30681dd291bd78276a8f2edb6e1a4e /book/src/main/scalatex/book/handson/ClientServer.scalatex | |
parent | aaea4afbf3b47d623f396cb1eae247fa92053032 (diff) | |
download | hands-on-scala-js-916476a310661a0b81011e0af429f356d5cd36e7.tar.gz hands-on-scala-js-916476a310661a0b81011e0af429f356d5cd36e7.tar.bz2 hands-on-scala-js-916476a310661a0b81011e0af429f356d5cd36e7.zip |
Small cleanup, book is now acyclic
Diffstat (limited to 'book/src/main/scalatex/book/handson/ClientServer.scalatex')
-rw-r--r-- | book/src/main/scalatex/book/handson/ClientServer.scalatex | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/book/src/main/scalatex/book/handson/ClientServer.scalatex b/book/src/main/scalatex/book/handson/ClientServer.scalatex index b29df03..817f568 100644 --- a/book/src/main/scalatex/book/handson/ClientServer.scalatex +++ b/book/src/main/scalatex/book/handson/ClientServer.scalatex @@ -15,7 +15,22 @@ @sect{A Client-Server Setup} @p - Getting started with client-server integration, let's go with the simplest configuration possible: a Spray server and a Scala.js client. Most of the other web-frameworks (Play, Scalatra, etc.) will have more complex configurations, but the basic mechanism of wiring up Scala.js to your web framework will be the same. + Getting started with client-server integration, let's go with the simplest configuration possible: a Spray server and a Scala.js client. Most of the other web-frameworks (Play, Scalatra, etc.) will have more complex configurations, but the basic mechanism of wiring up Scala.js to your web framework will be the same. Our project will look like this: + + @hl.bash + $ tree + . + ├── build.sbt + ├── client + │ ├── shared/main/scala/simple/FileData.scala + │ └── src/main/scala/simple/Client.scala + ├── project + │ └── build.sbt + └── server + ├── shared -> ../client/shared + └── src/main/scala/simple + ├── Page.scala + └── Server.scala @p First, let's do the wiring in @code{build.sbt}: @@ -94,4 +109,6 @@ @li Try adding additional functionality to the client-server interface: what about making it show the contents of a file if you've entered its full path? This can be added as a separate Ajax call or as part of the existing one. @li - How about setting up the build.sbt so it serves the fully-optimized Scala.js blob, @code{client-opt.js}? This is probably what you want before deployment into production, and the same technique as we used to serve the fast-optimized version applies here too.
\ No newline at end of file + How about setting up the build.sbt so it serves the fully-optimized Scala.js blob, @code{client-opt.js}? This is probably what you want before deployment into production, and the same technique as we used to serve the fast-optimized version applies here too. + @li + What if you wanted to use another server rather than Spray? How about trying to set up a Play or Scalatra server to serve our Scala.js application code?
\ No newline at end of file |