Consider introducing HttpApp for Java/Scala to lessen boilerplate #156

Closed
akka-ci opened this Issue Sep 8, 2016 · 7 comments

Projects

None yet

3 participants

@akka-ci
Collaborator
akka-ci commented Sep 8, 2016

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.

Idea comes back after https://twitter.com/li_haoyi/status/719914887309176832

The other points from the discussion are tracked already:

  • need better docs (we're working on that on multiple fronts)
  • client in need of high level api (we are painfully aware): akka/akka#16856
@akka-ci
Collaborator
akka-ci commented Sep 8, 2016

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...

@akka-ci
Collaborator
akka-ci commented Sep 8, 2016

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)?

@akka-ci
Collaborator
akka-ci commented Sep 8, 2016

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?

@ktoso ktoso added 1 - triaged and removed t:http labels Sep 8, 2016
@jlprat
Contributor
jlprat commented Oct 24, 2016

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.

@ktoso
Member
ktoso commented Oct 24, 2016

Would you like to contribute such base class? Help would be definitely welcome on this front :)

@jlprat
Contributor
jlprat commented Oct 24, 2016

I'd like to :). I don't know when I could invest some time on this, but sure!

@jlprat
Contributor
jlprat commented Nov 16, 2016

Just to clarify, this issue is about creating a "bootstrap" class to create easily servers that use the High Level API, right?

@jlprat jlprat added a commit to jlprat/akka-http that referenced this issue Jan 20, 2017
@jlprat @jlprat jlprat + jlprat 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
f3cf720
@ktoso ktoso added a commit that referenced this issue Jan 20, 2017
@jlprat @ktoso jlprat + ktoso 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
08e2511
@ktoso ktoso closed this Jan 20, 2017
@ktoso ktoso added community and removed 1 - triaged labels Jan 20, 2017
@ktoso ktoso added this to the 10.0.2 milestone Jan 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment