serverless / serverless-kubeless

This plugin enables support for Kubeless within the Serverless Framework.
Apache License 2.0
303 stars 81 forks source link

How to support folder in handler #121

Closed ijustyce closed 6 years ago

ijustyce commented 6 years ago

I use aws lambda in the past but it almost unavailable in China. So I try to use kubeless, but still have some questions, hople you can help me.

In the past my serverless.yml file like this:

  listIndexPicture:
    handler: picture/picture.list
    events:
      - http:
          path: picture/index
          method: get

But it seems that this plugin didn't support folder, I must write like this:

  save-music:
    handler: music.save
    events:
      - http:
          path: /music

If I make a folder named music and move music.js into music then change handler to music/music.save it will 503. If handler must in root folder I think itn't good for large project, maybe I can divide the project into a lots of small project but every small project may need some common utils just as helper.js, how to manage the common js is a problem for me. Also if I want to deploy the function to server I must goto the folder and run sls deploy then goto other folder and run command again.

If the handler support folder please let me know, thanks.

andresmgot commented 6 years ago

Hi @ijustyce,

indeed that is something that is not supported yet. If you are interested in the feature, could you open an issue in https://github.com/kubeless/kubeless/issues ? We would need to implement it there.