Express middleware to turn file extensions into Accept headers
Latest version : 1.0.0
Last updated on 2016-12-20T18:22:05.835Z
No examples found for this package
This module is express middleware to parse URLs containing
file extensions, set the
Accept header accordingly, and remove the extension.
I.e., the following request:
GET /widgets Accept: application/json
This is useful in sitations where the it's easier to use a file extension than set headers, such as in a download link.
$ npm install --save accepts-ext
import * as acceptsExt from 'accepts-ext' const app = express(); // ... app.use(acceptsExt);