Socket
Socket
Sign inDemoInstall

koa-accept-override

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    koa-accept-override

Middleware to override accept header with query or url path file extension


Version published
Maintainers
1
Install size
227 kB
Created

Readme

Source

express-accepts-override

npm version Coverage Status Circle CI

Middleware to override accepts header with query or url path file extension

Installation

npm install express-accepts-override

Usage

var acceptsOverride = require('express-accepts-override');

app.use(acceptsOverride(options));

Options

accepts: ['json', 'html', 'csv', 'txt'] // must be valid mime extensions query: 'format' // /path?format=csv resolveOrder: ['suffix', 'query', 'header'] // will use first match

resolveOrder options:

  • suffix: /somepath.json, /somepath.csv
  • query: /somepath?format=json, /somepath?format=csv (change 'format' to something else with options.query)
  • header: 'accepts:text/csv'

Keywords

FAQs

Last updated on 02 Jun 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc