0.1.0 • Published 9 years ago

blankgif v0.1.0

Weekly downloads
84
License
MIT
Repository
github
Last release
9 years ago

blankgif

For serving 1x1px transparent gif image with nodejs.

Setup

$ npm install --save blankgif

Usage

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

// option 1
app.get('/track.gif', blankgif.sendBlankGif);

// option 2
app.use(blankgif.middleware())
app.get('/track.gif', function(req, res) {

  process.nextTick(function() { /* do tracking stuff */ });

  res.set('Cache-Control', 'public, max-age=0');
  res.status(200).sendBlankGif();
});