Sinatra inspired web development framework for node.js -- insanely fast, flexible, and simple
Hey @euoia & @dougwilson, I see that activity is picking up again on GitHub 🎉
I'm a maintainer of Serverless Framework (https://github.com/serverless/serverless). We have more than 8,000 users/month deploying Express to AWS.
We want to build first-class integration between Express and AWS, and make it extremely easy for Express users.
We have some ideas we want to share with you, would you be interested to discuss it? Should we contact anyone else?
// Limit, 3 MegaBytes
// 1 << 10 = 1024 << 10 = 1024 * 1024
const limit = 3 << 20;
// Text Body Parser
server.use(function (req, res, next) {
let ln = req.get('content-length');
if (ln && ln > limit) {
res.sendStatus(413);
return;
}
req.body = '';
let overLimit = false;
req.on('data', chunk => {
if (overLimit) return;
req.body += chunk;
if (req.body.length > limit) {
overLimit = true;
res.sendStatus(413);
return;
}
});
req.on('end', () => {
if (!overLimit) next();
});
});