I have a small Akka Http server. Is there a way of listing all server routes/services?
A “Directive” is a small building block used for creating arbitrarily complex route structures. Akka HTTP already pre-defines a large number of directives and you can easily construct your own: Basics. Structure.
The Akka HTTP Core Server API provides a Flow - or Function -level interface that allows an application to respond to incoming HTTP requests by mapping requests to responses (excerpt from Low-level server side example): Scala.
Akka HTTP also provides an embedded, Reactive-Streams-based, fully asynchronous HTTP/1.1 server implemented on top of Streams.
Akka HTTP is made for building integration layers based on HTTP and as such tries to “stay on the sidelines”. Therefore you normally don't build your application “on top of” Akka HTTP, but you build your application on top of whatever makes sense and use Akka HTTP merely for the HTTP integration needs.
Currently this isn't simple without creating your own wrapper around the akka-http Scala DSL. More discussion here: https://github.com/akka/akka-http/issues/201
Long story short the Scala DSL isn't conducive to introspection.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With