This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-05
Channels
- # beginners (45)
- # boot (2)
- # cider (2)
- # cljs-experience (1)
- # cljsrn (6)
- # clojure (67)
- # clojure-brasil (1)
- # clojure-dusseldorf (47)
- # clojure-finland (7)
- # clojure-italy (81)
- # clojure-portugal (2)
- # clojure-russia (12)
- # clojure-sanfrancisco (1)
- # clojure-serbia (1)
- # clojure-spec (22)
- # clojure-uk (27)
- # clojurescript (49)
- # clojurewerkz (3)
- # code-reviews (3)
- # component (19)
- # core-async (3)
- # cursive (16)
- # events (7)
- # fulcro (20)
- # graphql (7)
- # immutant (1)
- # jobs (2)
- # juxt (44)
- # leiningen (7)
- # lumo (35)
- # onyx (31)
- # portkey (31)
- # portland-or (8)
- # random (1)
- # re-frame (82)
- # reagent (35)
- # sfcljs (1)
- # spacemacs (5)
- # specter (7)
- # unrepl (4)
- # yada (2)
so what I figure is that with :post
we would pass parsed json from API Gateway (have not yet figured out other content types, binary is nowadays an option too) into a single-arity mounted function
what api gw gives lookes like this now:
Mon Sep 04 19:57:03 UTC 2017 : Endpoint request body after transformations: {
“body-json” : {“a”:1},
“params” : {
“path” : {
}
,“querystring” : {
}
,“header” : {
}
},
“stage-variables” : {
},
“context” : {
“account-id” : “262355063596",
“api-id” : “04d57u6034",
“api-key” : “test-invoke-api-key”,
“authorizer-principal-id” : “”,
“caller” : “262355063596",
“cognito-authentication-provider” : “”,
“cognito-authentication-type” : “”,
“cognito-identity-id” : “”,
“cognito-identity-pool-id” : “”,
“http-method” : “POST”,
“stage” : “test-invoke-stage”,
“source-ip” : “test-invoke-source-ip”,
“user” : “262355063596",
“user-agent” : “Apache-HttpClient/4.5.x (Java/1.8.0_131)“,
“user-arn” : “arn:aws:iam::262355063596:root”,
“request-id” : “test-invoke-request”,
“resource-id” : “2jmogc”,
“resource-path” : “/h”
}
}
hmmm, what about Lambda Proxy Integration + ANY? http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-create-api-as-simple-proxy-for-lambda.html#api-gateway-proxy-integration-lambda-function-java
ring request/response map would anyway make talking to api gw a bit more consistent and familiar
/{all-paths-are-belong-to-me+}
https://aws.amazon.com/blogs/aws/api-gateway-update-new-features-simplify-api-development/
> Lambda Function Integration – A new default mapping template will send the entire request to your Lambda function and then turn the return value into an HTTP response.
on Zappa and over 50MB lambda https://github.com/Miserlou/Zappa/blob/master/README.md#large-projects
> Zappa makes it super easy to build and deploy all Python WSGI applications on AWS Lambda + API Gateway.
one for Clojure but lacks ease of use https://github.com/jpb/ring-aws-lambda-adapter