Created
March 3, 2023 18:52
-
-
Save js62789/5dd905b1f22baede98a2f0b7848a0baf to your computer and use it in GitHub Desktop.
This is a simple implementation of a tracking pixel using Express.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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