Skip to content

Instantly share code, notes, and snippets.

@doctorpangloss
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doctorpangloss/4a887f6d27ccb26ccea4 to your computer and use it in GitHub Desktop.
Save doctorpangloss/4a887f6d27ccb26ccea4 to your computer and use it in GitHub Desktop.
if (Meteor.isServer) {
WebApp.connectHandlers.use("/test", function (req, res, next) {
var data = '';
req.on('data', function (chunk) {
data += chunk;
});
req.on('end', Meteor.bindEnvironment(function () {
var deserialized = JSON.parse(data);
// Do your work here
console.log(deserialized.d.length);
res.end(data.length.toString());
}))
});
}
if (Meteor.isClient) {
Meteor.startup(function () {
var c = ' ';
var d = '';
for (var i = 0; i < Math.pow(10, 7) / 2; i++) {
d += c + c;
}
HTTP.post('http://localhost:3000/test', {data: {d: d.slice('undefined'.length)}}, function (e, r) {
console.log(e);
console.log(r);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment