Connect middleware to bucket user-agent strings into device groups
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.editorconfig
.gitignore
.travis.yml
README.md
connect_devicedetect.js
package.json

README.md

connect-devicedetect NPM version Build Status

Connect middleware to bucket user-agent strings into device groups.

Sets X-UA-Device header to phone, tablet or desktop based on user-agent. Sets X-UA-Device-Detailed header to mobile-iphone, mobile-android, tablet-ipad, tabled-android based on user-agent.

Useful as a development-time stub for edge-cache based detection like varnish-devicedetect when Varnish/Fastly are not proxying requests.

connect = require 'connect'
deviceDetect = require 'connect-devicedetect'

app = connect().use(deviceDetect())