portkey

Portkey: from REPL to Serverless in one call
cgrand 2017-09-09T08:03:41.000019Z

Considerations on awsgen the when form starting on this line https://github.com/portkey-cloud/aws-clj-sdk/blob/master/src/portkey/awsgen.clj#L242 has to grow from scratch for each protocol to be sure that every case is covered.

cgrand 2017-09-09T08:04:56.000008Z

Second, the conforming aspects of specs may be too much. Validation and transformation to a model of the message may have to be split.

viesti 2017-09-09T20:37:10.000055Z

user> (defn plus [data] (apply + (-> data :numbers)))
#‘user/plus
user> (plus {:numbers [1 2 3]})
6
user> (pk/mount! plus “/plus” :method :post)
Zip size 5.6MB
{:url “<https://04d57u6034.execute-api.eu-west-1.amazonaws.com/repl/plus“>}

&gt; curl -H “Content-Type: application/json” -X POST -d ‘{“numbers”: [1, 2, 3]}’ <https://04d57u6034.execute-api.eu-west-1.amazonaws.com/repl/plus>
&gt; 6

👍 1
viesti 2017-09-09T20:39:46.000004Z

did another try at POST support, ditched earlier branch and started anew

viesti 2017-09-09T20:40:12.000057Z

there’s duplication on the swagger definition side, but that will become better

viesti 2017-09-09T20:41:40.000107Z

still on the “simplest way to get arguments to a function” path, but introduction of ring (or something like it) would bring more rigour, I think