Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.main
- import akka.actor.{ActorSystem, Props}
- import akka.io.IO
- import akka.pattern.ask
- import akka.util.Timeout
- import spray.can.Http
- import scala.concurrent.duration._
- trait WebApp extends {
- // we need an ActorSystem to host our application in
- implicit val system = ActorSystem("spray-scala")
- // create and start our service actor
- val service = system.actorOf(Props[yServiceActor], "spray-service")
- implicit val timeout = Timeout(5.seconds)
- // start a new HTTP server on port 8080 with our service actor as the handler
- IO(Http) ? Http.Bind(service, interface = "localhost", port = 8888)
- }
- object Boot extends App with WebApp {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement