serverless-components / tencent-apigateway

Easily provision Tencent API Gateway using Serverless Components
https://www.serverless.com
MIT License
34 stars 7 forks source link

Protocols array #3

Closed pmuens closed 4 years ago

pmuens commented 4 years ago

This PR changes the config API to accept protocols defined as an array (rather than as a string).

It also introduces tape tests.

Other code we might need to update:

Closes #2

yugasun commented 4 years ago

@pmuens If you change protocol to protocols,as you mentioned, we should update all components depend on it. So why not just deal with http&https string in tencent-apigateway component?

pmuens commented 4 years ago

@pmuens If you change protocol to protocols,as you mentioned, we should update all components depend on it. So why not just deal with http&https string in tencent-apigateway component?

thanks for the review. Yes, I agree that it's very unfortunate that we have to update all the dependent components (I'll, of course take care of this).

The main rationale here is that http&https is an implementation detail in the Tencent API and not a valid protocol. Turning this into an array provides a higher level of abstraction, therefore makes it easier to extend later on, more user friendly and hides the APIs implementation detail.

pmuens commented 4 years ago

@yugasun I've updated all the places where we've used tencent-apigateway.

yugasun commented 4 years ago

@pmuens Well done~

pmuens commented 4 years ago

@pmuens Well done~

Thanks! :+1: