Skip to content

Instantly share code, notes, and snippets.

@t0mdicks0n
Created December 21, 2017 08:40
Show Gist options
  • Save t0mdicks0n/8aa76dd6325a2f2cc109b2a2e48ecdbd to your computer and use it in GitHub Desktop.
Save t0mdicks0n/8aa76dd6325a2f2cc109b2a2e48ecdbd to your computer and use it in GitHub Desktop.
A small Node Server Application to demonstrate what data get sent to Facebook when the Facebook Pixel is included in a web app.
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var jsonParser = bodyParser.json();
app.use(bodyParser.json({limit: '50mb'}));
app.enable('trust proxy')
app.get('/thomas', function(req, res) {
requestData = {
"Cookies" : req.headers['cookie'],
"Host" : req.headers['host'],
"User-Agent" : req.headers['user-agent'],
"Path" : req.route.path,
"IP" : req.ip
};
console.dir(requestData, {depth: null, colors: true})
res.json(JSON.stringify(requestData));
});
var port = 1447;
app.listen(port, '0.0.0.0', function() {
console.log(`listening on port ${port}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment