basic file-sending utility for koa
Basic file-sending utility for koa. It does the following:
It does not:
You must pass
this as the context.
filename is the filename of the file.
stats is the
fs.stat() result of the filename. If
stats exists, that doesn't mean that a response is set - the filename could be a directory. Instead, check
var sendfile = require'koa-sendfile'appusevar stats = yield* sendfilecallthis '/Users/jong/.bash_profile'if !thisstatus thisthrow404