joostfarla / serverless-cors-plugin

Serverless CORS Plugin - Managing Cross-origin resource sharing (CORS) policies
ISC License
70 stars 15 forks source link

Serverless 1.7 compatibility #30

Closed jurosh closed 7 years ago

jurosh commented 7 years ago

After including plugn in project I've got error:

Type Error ---------------------------------------------

     S.getServerlessPath is not a function

     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues

     Please report this error. We think it might be a bug.

  Your Environment Information -----------------------------
     OS:                 win32
     Node Version:       7.2.0
     Serverless Version: 1.7.0

Looks like another plugin had same issue: https://github.com/serverless/serverless-client-s3/pull/43

joostfarla commented 7 years ago

@jurosh The plugins you are using are built for older versions of Serverless. Since v1.0, Serverless has native support for CORS. You can find the docs here: https://serverless.com/framework/docs/providers/aws/events/apigateway/#enabling-cors

jurosh commented 7 years ago

Would be good to update readme.md with note that from V1.0 it's built in "THIS PLUGIN REQUIRES SERVERLESS V0.5 OR HIGHER!"

It's probably then V0.5 < V1.0

joostfarla commented 7 years ago

I've just adapted the readme. Thanks for the suggestion!