Stats

 Latest version : 0.1.1

 Last updated on 2018-08-12T08:12:49.519Z

 Keywords : accept, content, negotiation, middleware, rest, api

 Downloads :

  • 18 in Last Month

 Links :

 Examples

¯\_(ツ)_/¯
No examples found for this package

 Readme

Acceptable

Build Status

Purpose

Error fast/early for 406 Not Acceptable requests

Installation

Via npm

npm install acceptable

Usage

Coffeescript

express = require 'express'
acceptable = require 'acceptable'

app = express()
app.use acceptable('json', 'txt', 'html', 'xml', 'js', 'jpg')

Javascript

var express = require('express');
var acceptable = require('acceptable');

var app = express();

app.use(acceptable('json', 'txt', 'html', 'xml', 'js', 'jpg'));

Test

npm install
npm test

 Comments