In part one
and part two
of this series, we looked at how to build a ClojureScript environment that
we can deploy to AWS Lambda and the API Gateway that will respond to the outside
world as a web service. With that done, today we’ll see how to go about
One of the common synonyms for “serverless” is “Function as a Service”:
there is a place in the cloud that we upload a function to, and it runs
when some event is triggered. Web services are easily modeled as
functions in Clojure/Script, so that’s how we’re going to set ours up.
Listening to game three of the National League Divisional Series
between the Washington Nationals and Los Angeles Dodgers today on
the way to the airport, I heard a startingly weighty statistic: The
team that wins game three of a five-game series wins 77% of series!
That’s one pivotal game!
I’ve been experimenting with clojure.spec on a new web project, as a way of validating data coming in from the client. We’re using JSON API as the lingua franca between the server and client, which adds a not-insignificant amount of ceremony and overhead to the JSON payload. So once I got one namespace’s endpoints spec’ed correctly, the obvious next step was to generalize it with a function that looked like this (edited for brevity):