Fast background
I am looking at a few examples studying the Akka HTTP stack to create a new REST project (completely non-UI). I use and complement the Akka HTTP Microservice Example to work through a bunch of use cases and configurations, and was pleasantly surprised at how well Scala and Akka HTTP work.
Current setting
I currently have this configuration:
object AkkaHttpMicroservice extends App with Service { override implicit val system = ActorSystem() override implicit val executor = system.dispatcher override implicit val materializer = ActorMaterializer() override val config = ConfigFactory.load() override val logger = Logging(system, getClass) Http().bindAndHandle(routes, config.getString("http.interface"), config.getInt("http.port")) }
The routes parameter is a simple value that has typical data inside it using path , pathPrefix , etc.
Problem
Is there a way to configure routing in multiple Scala files or an example somewhere out there?
I would really like to be able to define a set of classes that share problems and handle the configuration and processing of the Actor to work with various areas of the application and simply leave marshaling for the root extension of the App .
Perhaps I was thinking too much about how I was doing something in Java using annotations like @javax.ws.rs.Path("/whatever") for my classes. If so, feel free to point out a change in thinking.
I tried to find several different keywords, but I think that I am asking the wrong question (for example, 1 , 2 ).
el n00b
source share