Advertisement
Guest User

Untitled

a guest
Aug 21st, 2015
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.67 KB | None | 0 0
  1. package com.main
  2.  
  3. import akka.actor.{ActorSystem, Props}
  4. import akka.io.IO
  5. import akka.pattern.ask
  6. import akka.util.Timeout
  7. import spray.can.Http
  8.  
  9. import scala.concurrent.duration._
  10.  
  11. trait WebApp extends {
  12.  
  13.   // we need an ActorSystem to host our application in
  14.   implicit val system = ActorSystem("spray-scala")
  15.  
  16.   // create and start our service actor
  17.   val service = system.actorOf(Props[yServiceActor], "spray-service")
  18.  
  19.   implicit val timeout = Timeout(5.seconds)
  20.   // start a new HTTP server on port 8080 with our service actor as the handler
  21.   IO(Http) ? Http.Bind(service, interface = "localhost", port = 8888)
  22. }
  23.  
  24. object Boot extends App with WebApp {
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement