Here's the code from an example:
import spray.routing.SimpleRoutingApp
object Main extends App with SimpleRoutingApp {
implicit val system = ActorSystem("my-system")
startServer(interface = "localhost", port = 8080) {
path("hello") {
get {
complete {
<h1>Say hello to spray</h1>
}
}
}
}
}
Found at http://spray.io/documentation/1.1-SNAPSHOT/spray-routing/#spray-routing
Please forgive my noobiness, as I come from a Java background... I'm trying to pick up the Scala language as well this framework at the same time. I semantically understand what's happening here, but syntactically I'm very confused.
I'd like to understand what constructs in the Scala language are applied here, specifcally starting from the call to "startServer" and the implementation in between the {}. That way I can Google it up and research it...but I'm not sure what to look up here. I think it may be related some of the functional concepts in the language.
"startServer" seems to be a method of the SimpleRoutingApp, but it looks like you are passing in nested functions into its body, i.e "path", "get", "complete" ...How does this exactly work? Thanks for all the help.