Skip to content

How to customise response MIME types

Lloyd Brookes edited this page Jun 25, 2017 · 5 revisions

By default, a request for a static resource with the file extension .php will return a response with a Content-Type value of application/x-httpd-php. This middleware enables you to override the default mime-type-file-extension mapping.

To configure additional mime-type mappings or override the defaults, set a mime property in the stored config. This value is passed directly to mime.define(). Example:

{
  mime: {
    'text/plain': [ 'php', 'pl' ]
  }
}
Clone this wiki locally