mimeTypes property

Map<String, ContentType> mimeTypes
read / write

Local MIME types specific to this object.

This is used for matching file extensions to MIME types. The file extensions are strings without the full stop.

This list is examined in preference to the defaultMimeTypes map. If a match is found in this property, defaultMimeTypes is not examined. Otherwise it is examined.

Example:

var sf =  new StaticFiles("/var/show/assets/publish");
sf.mimeTypes["rss"] = new ContentType("application", "rss+xml");
sf.mimeTypes["mp3"] = new ContentType("audio", "mpeg");

pipeline.get("~/podcast/*", sf.handler);

This map is initially empty.

Implementation

Map<String, ContentType> mimeTypes = {}