aws-serverless-express-binary

1.0.1 • Public • Published

AWS Serverless Express

Customized from https://github.com/awslabs/aws-serverless-express. This supported image upload via node server like NestJS, etc...

Getting Started

Check details at: https://github.com/awslabs/aws-serverless-express

npm install aws-serverless-express-binary

Sample

req.on("data", function(chunk) {
  data.push(chunk);
})
.on("end", function() {
  body = Buffer.concat(data).toString();
  var bb = new busboy({ headers: { 'content-type': contentType } });

  bb.on('file', function (fieldname, file, filename, encoding, mimetype) {
    const mimeType = mimetype;
    const ext = filename.split('.')[1];
    let chunks;
    file.on('data', function (data) {
      chunks = data;
    }).on('end', function () {
      let base64Image = new Buffer(chunks.toString(), 'binary').toString('base64');
      const fileData = new Buffer(base64Image, 'base64');
    });
  })

  bb.end(body);

Package Sidebar

Install

npm i aws-serverless-express-binary

Weekly Downloads

187

Version

1.0.1

License

Apache-2.0

Unpacked Size

29.7 kB

Total Files

9

Last publish

Collaborators

  • abinhho