Tuesday, April 15, 2014

Spray + Bootstrap

https://bitbucket.org/diversit/spray-twirl-bootstrap
https://github.com/spray/spray-template

"Spray - Twirl - Twitter Bootstrap" Template Project

This project is based on the Spray Template project. I added support for serving static files, added Twitter Bootstrap files and added Twirl for templating. You can use this project as a template for a REST API or even serve a website.
Spray routing is split up in serveral traits for static routing, twirl pages and inline html.
This project uses Git Flow.
Follow these steps to get started:
  1. Git-clone this repository.
    $ git clone git@bitbucket.org:diversit/spray-twirl-bootstrap.git my-project
    
  2. Change directory into your clone:
    $ cd my-project
    
  3. Launch SBT:
    $ sbt
    
  4. Compile everything and run all tests:
    > test
    
    Note: For the Selenium Chome test to be able to run, you need to install thechromedriver locally. Read my blogpost about how Selenium is setup for ScalaTest. And read the ScalaTest Selenium documentation for using Selenium in ScalaTests.
  5. Start the application:
    > re-start
    
  6. Browse to http://localhost:8080/
  7. Start the application:
    > re-stop
    
  8. Start hacking on src/main/scala/com/example/MyService.scala



Spray Project
This projects provides a starting point for your own spray-routing endeavors. There are 8 branches, providing templates for spray-routing on
  • spray-can, Scala 2.9 + Akka 2.0 + spray 1.0 (the on_spray-can_1.0 branch)
  • spray-can, Scala 2.10 + Akka 2.1 + spray 1.1 (the on_spray-can_1.1 branch)
  • spray-can, Scala 2.10 + Akka 2.2 + spray 1.2 (the on_spray-can_1.2 branch)
  • spray-can, Scala 2.10 + Akka 2.3 + spray 1.3 (the on_spray-can_1.3 branch)
  • Jetty, Scala 2.9 + Akka 2.0 + spray 1.0 (the on_jetty_1.0 branch)
  • Jetty, Scala 2.10 + Akka 2.1 + spray 1.1 (the on_jetty_1.1 branch)
  • Jetty, Scala 2.10 + Akka 2.2 + spray 1.2 (the on_jetty_1.2 branch)
  • Jetty, Scala 2.10 + Akka 2.3 + spray 1.3 (the on_jetty_1.3 branch)
You are currently on the on_spray-can_1.1 branch.
> git clone git://github.com/spray/spray-template.git my-project -b on_spray-can_1.3

No comments: