routil-encoding

0.0.1 • Public • Published

routil-encoding build status

handle multiple encodings

Example

var http = require("http")
    , encoding = require("routil-encoding")
    , data = someData

http.createServer(function (req, res) {
    encoding(req, {
        "gzip": returnGzipped
        , default: returnNormal
    })(req, res)
}).listen(8080)

function returnGzipped(req, res) {
    // some gzip function
    gzip(data, function (gzipped) {
        res.end(gzipped)
    })
}

function returnNormal(req, res) {
    res.end(data)
}

Installation

npm install routil-encoding

Tests

make test

Contributors

  • Raynos

MIT Licenced

Readme

Keywords

none

Package Sidebar

Install

npm i routil-encoding

Weekly Downloads

0

Version

0.0.1

License

none

Last publish

Collaborators

  • raynos