Created
July 12, 2017 09:56
-
-
Save NekrasovEV/cc799ee45e4831fda53ccb5f7deca410 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
const busboy = require('co-busboy') | |
const parts = busboy(ctx, { | |
limits: { | |
fieldSize: 10 * 1024 * 1024, | |
}, | |
}) | |
let part | |
while (part = await parts) { | |
switch (part[0]) { | |
case 'message': { | |
body.message = part[1] | |
break | |
} | |
case 'files': { | |
body.files.push(await obj.run(part[1])) | |
break | |
} | |
default: | |
break | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment