Giter Club home page Giter Club logo

Comments (7)

adrai avatar adrai commented on May 20, 2024

Would using the binaryMimeTypes option also work instead of introducing a new option?
What if you have other routes not needing binary?

from aws-lambda-fastify.

adrai avatar adrai commented on May 20, 2024

btw: have you defined multipart/form-data as a binary media type for your API, like described here?
If so can you share how your lambda event looks like?

from aws-lambda-fastify.

6unpk avatar 6unpk commented on May 20, 2024

umm.. i tested with serverless-offline plugin and serveless config(serverless.ts) looks like

provider: {
    name: 'aws',
    runtime: 'nodejs14.x',
    lambdaHashingVersion: 20201221,
    stage: 'dev',
    region: 'ap-northeast-2',
    logRetentionInDays: 14,
    memorySize: 256,
    apiGateway: {
      binaryMediaTypes: ['multipart/form-data', 'image/*'],
      apiKeySourceType: 'HEADER',
      minimumCompressionSize: 5000,
    },
 ...
}

and this is lambda event

'create-template': {
      handler: 'src/functions/create-template/handler.main',
      events: [
        {
          http: {
            path: 'upload/templates',
            method: 'post',
            cors: corsPolicy,
            private: true,
          },
        },
      ],
    },

Would using the binaryMimeTypes option also work instead of introducing a new option? What if you have other routes not needing binary?

i already tried to solve this problem with binaryMimeType. but i can't still find reason why not working with binaryMimeType...

from aws-lambda-fastify.

adrai avatar adrai commented on May 20, 2024

and this is lambda event

I mean the real aws lambda event that is passed in your lambda handle function...

something like:

exports.handler = async (event, context) => {
  console.log(JSON.stringify(event, null, 2))
  return proxy(event, context)
}

from aws-lambda-fastify.

adrai avatar adrai commented on May 20, 2024

fyi: I just added some multipart tests.... seems to work: e274f7e

from aws-lambda-fastify.

6unpk avatar 6unpk commented on May 20, 2024

oh,, i'm sry for confusion. atfter i have tried many times, figured out it happens due to local environment. it works on real aws api gw and lambda environment. thanks for reply!

from aws-lambda-fastify.

6unpk avatar 6unpk commented on May 20, 2024

close PR too

from aws-lambda-fastify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.