Issue by ktoso
Tuesday Apr 12, 2016 at 21:36 GMT
Originally opened as akka/akka#20299
We could provide (for java we once did), an HttpApp trait that'd work like App that's setting up akka etc and require overriding def routes: Route, it would simplify the "hello world" examples for the server side.
def routes: Route
Idea comes back after https://twitter.com/li_haoyi/status/719914887309176832
The other points from the discussion are tracked already:
Comment by 2beaucoup
Wednesday Apr 13, 2016 at 06:44 GMT
The high level APIs mentioned in #16856 seems to be done.
I can imagine that additional shortcuts like HTTP().get("http://akka.io/") could become handy. But that would be another alternative way of doing things. Oh my...
Comment by ktoso
Wednesday Apr 13, 2016 at 08:29 GMT
Let's take the discussion on client api to the client ticket :)
Here opinions on HttpApp / SecureHttpApp / HttpsApp (naming bikeshed needed to)?
Comment by johanandren
Wednesday Apr 13, 2016 at 08:49 GMT
While I definitely agree on that we could improve the getting started experience with the docs (which are more styled like a technical manual than the tutorial style of the python-requests docs referenced)
I don't agree that there should be a way to have all dependencies magically setup for you.
I think that would be falling for something like a hello world fallacy, not actually useful because so few will be writing an application using akka-http that just makes one or two http calls (BTW in that case bash with curl or wget would be less boilerplate than Python).
I also think that we have chosen explicit self contained samples over minimal, so that users can just copy and paste and run. Maybe we could create some kind of toggle for "full" vs "minimal without boilerplate" for the code samples in akka docs?
I completely agree with this. Currently for any Hello World example, there is too much code I need to copy/paste from the previous one.
Less boiler plate code leads to more clarity and easy-to-use libraries and hopefully higher adoption.
Would you like to contribute such base class? Help would be definitely welcome on this front :)
I'd like to :). I don't know when I could invest some time on this, but sure!
Just to clarify, this issue is about creating a "bootstrap" class to create easily servers that use the High Level API, right?
Provide HttpApp API for Scala and Java #156
Experimental API to help on starting an http server.
Add documentation on how to use it
Add tests for it