maciejtreder / serverless-apigw-binary

Serverless plugin for binary files support in AWS Gateway
MIT License
160 stars 33 forks source link

Is it possible to use this plugin locally? #30

Open gitowiec opened 7 years ago

gitowiec commented 7 years ago

I would like to use this plugin when calling serverless webpack serve --function run locally for development. I did it but the event parameter does not contain file content (I use Postman with POST and binary file in body) Here's my serverless.yml:

service: serverless-chrome

provider:
  name: aws
  runtime: nodejs6.10
  stage: dev
  region: eu-west-2
  environment:
    CHROME_PATH: ${opt:chromepath, './headless-chrome/headless_shell'}

custom:
  webpackIncludeModules: false # disable auto including modules
  apigwBinary:
      types:           #list of mime-types
        - 'application/zip'
        - 'application/octet-stream'
        - 'application/x-zip-compressed'
        - 'text/html'
        - 'text/plain'
        - 'text/css'
        - 'text/javascript'

plugins:
  - serverless-webpack
  - serverless-apigw-binary

functions:
  run:
    description: Run headless Chromium
    memorySize: 1536
    timeout: 30
    handler: handler.run

    events:
      - http:
          path: package
          method: post
maciejtreder commented 7 years ago

Hello,

Thanks for this report. I will take a look at it in the first possible moment.

zivc commented 6 years ago

Any news on this one?

RPDeshaies commented 6 years ago

Up :) !

fusionbeam commented 5 years ago

it doesn't look like this works in local/offline mode.

fusionbeam commented 5 years ago

correction. it works fine.

mooniker commented 5 years ago

this thread isn't applicable to using serverless-offline, is it? Having a similar issue.