-
-
Notifications
You must be signed in to change notification settings - Fork 121
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
Implement res.sendFile
#17
Comments
Hi @talentlessguy i would like to take this on, is the shape of sendFile function has to be just like express? |
@ahmad-reza619 yeah must work the same code might differ |
@ahmad-reza619 also, if possible, it shouldn't introduce any new dependencies |
is this sendFile function will be able to send any kind of file? like maybe mp3 file? |
From what i see from express test case, it looked like it only send file with text inside it |
@ahmad-reza619 hmmm I think u're right but I by myself can't undertsand whether it sends a file with Content-Disposition header to download it, or just raw file need to investiage more and re-check the implementation |
implemented in 2bba94c, but not 1:1 to express need more time to make it have the same API |
I think it's implemented properly, if anyone has suggestions, feel free to write here and I will re-open the thread |
Is your feature request related to a problem? Please describe.
res.sendFile
is commonly used in Express apps. tinyhttp must have one too.Describe the solution you'd like
Implement
res.sendFile
based on existingres.send
functionAdditional context
Express docs reference: http://expressjs.com/en/5x/api.html#res.sendFile
Express implementation: https://github.com/expressjs/express/blob/ecd8a08c1c9c4d60b466b451fd1f5c3fe8a5fb23/lib/response.js#L403
The text was updated successfully, but these errors were encountered: