Skip to content

Instantly share code, notes, and snippets.

@js62789
Created March 3, 2023 18:52
Show Gist options
  • Save js62789/5dd905b1f22baede98a2f0b7848a0baf to your computer and use it in GitHub Desktop.
Save js62789/5dd905b1f22baede98a2f0b7848a0baf to your computer and use it in GitHub Desktop.
This is a simple implementation of a tracking pixel using Express.js
import express from 'express';
const app = express();
const pixel = Buffer.from('R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7', 'base64');
app.get('/pixel.gif', (req, res) => {
res.writeHead(200, {
'Content-Type': 'image/gif',
'Content-Length': pixel.length,
});
res.end(pixel);
});
app.listen(3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment