cloudflare / serverless-cloudflare-workers

Serverless provider plugin for Cloudflare Workers
BSD 3-Clause "New" or "Revised" License
175 stars 37 forks source link

Same route for matching and invoke #19

Closed mw866 closed 5 years ago

mw866 commented 5 years ago

The new config schema use the same route (events > url) for both

This design causes issue. For example, (b) leads to the following error.


sls deploy -f imgresizing
Serverless: ✅  Script Deployed
Serverless: ❌  Fatal Error, Routes Not Deployed!
Serverless: --> Error Code:10022
--> Error Message: "Route pattern should not have query parameters example.com/api?arg=123"```
jspies commented 5 years ago

Thanks for filing this. The design change is to be in line with all of the other providers. For invoke, we will have to use --data. I will make sure this works and get the documents updated.

jspies commented 5 years ago

We released the querystring option so you can do this now

sls invoke -f functionname --querystring="q=search&s=stuff"
mw866 commented 5 years ago

Wonderful! Thanks @jspies .