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

Improve HTTP::Server docs #7251

Merged
merged 4 commits into from
Jan 24, 2019

Conversation

straight-shoota
Copy link
Member

This is a general overhaul of the HTTP::Server API docs, describing the updated behaviour after #5776.
It adds some more details and structures the text.

I've left out the section about reusing connections which will be added with the changed behaviour in #7055.

src/http/server.cr Outdated Show resolved Hide resolved
src/http/server.cr Outdated Show resolved Hide resolved
src/http/server.cr Outdated Show resolved Hide resolved
Co-Authored-By: straight-shoota <johannes.mueller@smj-fulda.org>
@straight-shoota
Copy link
Member Author

straight-shoota commented Jan 2, 2019

Thanks @r00ster91 for proof reading! ❤️

# For example, an initial handler might handle exceptions raised from subsequent
# handlers and return a `500 Server Error` status (see `HTTP::ErrorHandler`).
# The next handler might log all incoming requests (see `HTTP::LogHandler`).
# And the final handler deals with routing and application logic.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are dropping how the optional block interact with the rest of the handlers.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow. Are you referencing an intended change to the behaviour?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it relevant for this PR? I didn't change this sentence, only split it from the previous one.

src/http/server.cr Outdated Show resolved Hide resolved
@RX14
Copy link
Contributor

RX14 commented Jan 3, 2019

I think I'd prefer the ordering to talk about how the block form works first, and the role of HTTP::Context and then digress into HTTP::Handler, followed by talking about binding. I think this order reflects the order which a newbie would want to explore the server: first how to integrate your logic, since that's the interesting part. Then only after how to actually use the interface.

@sdogruyol sdogruyol merged commit a590f3d into crystal-lang:master Jan 24, 2019
@sdogruyol sdogruyol added this to the 0.27.1 milestone Jan 24, 2019
@straight-shoota straight-shoota deleted the jm/docs/http-server branch February 4, 2019 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants