Last active
August 29, 2015 14:21
-
-
Save doctorpangloss/4a887f6d27ccb26ccea4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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