-
Notifications
You must be signed in to change notification settings - Fork 321
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
Static files #415
Static files #415
Conversation
@yoshuawuyts Is there any reason why the original |
@pickfire this is more of a temporary name than anything else. Ideally we could get closer to http-types' way of constructing requests and responses but this is a stopgap in the meantime. |
@yoshuawuyts It seemed similar to the one in http-types. Is there any reason why it uses |
df055e0
to
517e44b
Compare
a7bc028
to
9a54d4f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i haven't looked at tide much but this part looks good :)
@pickfire
I suspect we'll be adding more methods to request and response for reading the body as various types. Likely candidates include: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was reading the code out of curiosity and wrote down some thoughts that came up while doing so, I hope you don’t mind.
@yoshuawuyts But why do we need so many different methods? Couldn't that be just |
@pickfire in the http-types model both Personally I really dislike the *req.body_mut() = MyBody; Std doesn't use this pattern anywhere, and instead prefers the distinction between The convenience methods I mentioned earlier are really only to move beyond the basics. Being able to automatically deserialize from JSON while respecting encodings is pretty hard to do, and providing a shorthand for this is useful. This goes for many of the other methods as well. |
This depends on #414 Add serve_dir method to Route Update serve_dir.rs Adjust methods so body can correctly be sent along tweak static file serving simplify internals cargo fmt & fix tests fix all tests cargo fmt Fix merge conflicts with master undo bonus changes Fix static path prefix stripping err
26e83d5
to
f3af561
Compare
Init static file serving support. This depends on #414.