Skip to content
Myr

Added settings docs

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

authored by visionmedia · committed by visionmedia · parent 4598445 · Browse files · 3 files+12 added−6 removed
This commit

State

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

Diff stats

3 files+12 added−6 removed

  • tests:+1 added−1 removed
  • other:+11 added−5 removed

3 files+12 added−6 removed

modified:lib/express.mime.js+4 added-5 removed
5 unmodified lines
6 Express.Mime = {7 name : 'mime',8 9 settings : {10 defaultType : null10 defaultType : 'application/octet-stream'11 },12 13 utilities : {14 15 /**16 * Returns the media type of _ext_, where _ext_ may be an17 * extension ('jpeg') or a file path ('path/to/image.name.jpeg'). 18 * Defaults to Express.settings.mime.defaultType or 'application/octet-stream'.18 * Defaults to Express.settings.mime.defaultType.19 *20 * @param {string} ext21 * @return {string}22 * @api public
1 unmodified line
24 25 mime : function(ext) {26 if (ext.indexOf('.') != -1) 27 ext = ext.substring(ext.lastIndexOf('.') + 1, ext.length)28 return Express.utilities.mimeTypes[ext] || 29 Express.settings.mime.defaultType ||30 'application/octet-stream'28 return Express.utilities.mimeTypes[ext] || Express.settings.mime.defaultType29 30 },31 32 mimeTypes : {33 "3gp" : "video/3gpp",
169 unmodified lines
modified:spec/spec.mocks.js+1 added-1 removed
modified:Readme+7 added
76 unmodified lines
77 post('login', function() {78 'Welcome ' + param('user').name79 })80 81== Settings8283 * basepath : defaults to '/'84 * defaultRoute : responds with page not found85 * mime.defaultType : defaults to 'application/octet-stream'86 * cookie.maxAge : defaults to 3600 milliseconds87 88== Public API8990 * Coming Soon91
24 unmodified lines