Implement `res.sendFile`
See original GitHub issueIs 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 existing res.send
function
Additional 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
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Express.js res.sendFile() Function - GeeksforGeeks
The res.sendFile() function basically transfers the file at the given path and it sets the Content-Type response HTTP header field based on ...
Read more >res.sendFile absolute path - node.js - Stack Overflow
You need to use an absolute path directly with res.sendFile . There are two simple ways to do it: res.sendFile(path.join(__dirname, '.
Read more >API Reference - Express 4.x
Creates an Express application. The express() function is a top-level function exported by the express module. var express = require('express') var app ...
Read more >Using Express res.sendFile() Function to Serve Files
Express provides a method in the response object of the router called sendFile() that can be used to serve static files. res.sendFile() method ......
Read more >Send Static Files in Express with sendFile() - Mastering JS
Express ' sendFile() function lets you send a raw file as a response to an HTTP request. You can think of res.sendFile() as...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ahmad-reza619 yeah must work the same
code might differ
implemented in 2bba94ce9ee521a3bc10d448757c73889f6f8e1c, but not 1:1 to express
need more time to make it have the same API