sendDate
property which you can set to false to disable this header. Don't recall how to access the vanilla response with spirit though, @hnry?
export default handler => request => {
return new Promise((resolve, reject) => {
const req = request.req();
const chunks = [];
req.on('data', data => {
chunks.push(data.toString());
});
req.on('end', () => {
request.body = chunks.join('');
console.log(request.body);
resolve(request);
});
});
};
request.req()
generates a huge object. Is there any more efficient way to just get the body's chunks? There seems to be a lot of overhead just from that one call. Would be awesome to be able to avoid it.
@hnry glad to hear that, we're using spirit for our node servers in production right now. It's amazing how simple and minimalistic it is. :)
Only thing I'm wondering so far is how to modify the default "error -> stack trace" behavior, preferably without middleware and instead replacing it where it's invoked.
Resoning for that is that leaking stack traces in production isn't a good thing to do and middleware seems to be relatively taxing.
spirit.node.is_response
for that to check, but if you don't care about setting a custom error message for specific or generic things, then the easiest way would be to set the NODE_ENV to production and it won't dump the stack for 500 responses