Skip to content
Cannot retrieve contributors at this time
23 lines (18 sloc) 689 Bytes
package spray.examples
import{Props, ActorSystem}
import spray.servlet.WebBoot
// This class is instantiated by the servlet initializer.
// It can either define a constructor with a single
// `javax.servlet.ServletContext` parameter or a
// default constructor.
// It must mplement the spray.servlet.WebBoot trait.
class Boot extends WebBoot {
// we need an ActorSystem to host our application in
val system = ActorSystem("example")
// the service actor replies to incoming HttpRequests
val serviceActor = system.actorOf(Props[DemoService])
system.registerOnTermination {
// put additional cleanup code here"Application shut down")
You can’t perform that action at this time.