Skip to content
Myr

Added Request#sendfile()

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by visionmedia · committed by visionmedia · parent 542a90a · Browse files · 2 files+18 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+18 added−1 removed

  • other:+18 added−1 removed

2 files+18 added−1 removed

modified:examples/app.js+1 added-1 removed
modified:lib/express/request.js+17 added
12// Express - Request - Copyright TJ Holowaychuk <tj@vision-media.ca> (MIT Licensed)34/**5 * StaticFile for Request#sendfile()6 */78var StaticFile = require('express/static').File910/**11 * Default response code bodies.12 */1314var statusBodies = {
224 unmodified lines
239 })240 this.plugins.each(function(plugin){241 plugin.trigger(new Event(name, data))242 })243 },244 245 /**246 * Transfer static file at the given _path_.247 *248 * @param {string} path249 * @api public250 */251 252 sendfile: function(path) {253 (new StaticFile(path)).send(this)254 }255})