Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
1 task
akka-ci opened this issue Sep 8, 2016 · 7 comments
Closed
1 task

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

akka-ci opened this issue Sep 8, 2016 · 7 comments
Labels
discuss Tickets that need some discussion before proceeding help wanted Identifies issues that the core team will likely not have time to work on
Milestone

Comments

@akka-ci
Copy link

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:

@akka-ci akka-ci added discuss Tickets that need some discussion before proceeding t:http labels Sep 8, 2016
@akka-ci
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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 Tickets that are safe to pick up for contributing in terms of likeliness of being accepted and removed t:http labels Sep 8, 2016
@jlprat
Copy link
Member

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
Copy link
Member

ktoso commented Oct 24, 2016

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

@jlprat
Copy link
Member

jlprat commented Oct 24, 2016

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

@jlprat
Copy link
Member

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 added a commit to jlprat/akka-http that referenced this issue Jan 20, 2017
Experimental API to help on starting an http server.
Add documentation on how to use it
Add tests for it
ktoso pushed a commit that referenced this issue Jan 20, 2017
Experimental API to help on starting an http server.
Add documentation on how to use it
Add tests for it
@ktoso ktoso closed this as completed Jan 20, 2017
@ktoso ktoso added help wanted Identifies issues that the core team will likely not have time to work on and removed 1 - triaged Tickets that are safe to pick up for contributing in terms of likeliness of being accepted 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
Labels
discuss Tickets that need some discussion before proceeding help wanted Identifies issues that the core team will likely not have time to work on
Projects
None yet
Development

No branches or pull requests

3 participants