In the previous installment , we displayed some dynamic content in our webpage that was loaded from an ets table. Even a social network themed around The Wire is no fun if you can’t add your favorite quotes to it. Let’s hook up a form so that we can submit to post new tweets, and a resource to accept that POST. Creating tweets Our HTML file already has portions of a form in it, but let’s add the…
Last time we started serving static files from the priv directory, supporting validation caching, conditional requests, and compression. But since static files are pretty boring, let’s populate our application’s page with some dynamic content. Dynamic content Instead of the static “tweets” in the homepage, let’s replace them with some content injected via Ajax. First, remove all of the <li>…
Last time , we got our project set up and serving some simple dynamic content. In this installment, we’ll show how to serve static files via Webmachine so we can discuss lots of its best features. Serving static files Most times you would let a web-server like Apache or nginx serve your static files, but for our tutorial it’s nice to serve our content directly via Webmachine. By doing so, we can…
Webmachine is an Erlang project I’ve known and used for years, especially thanks to my experience at Basho. One of the things that made me proud to use it was its opinionated nature about HTTP, namely, that in most cases you don’t have to manually set status codes or supply response headers. Instead, you supply predicate functions that answer very specific questions about your HTTP resource, and…
This is the first in a series based on the talk I gave at Code PaLOUsa 2014 entitled “In Search of the Software Ursatz” . It has been a long time since I wrote on this blog, but it has been an equally long time (or more) that I have been thinking about the topic of this series of posts. What I want introduce to you, dear reader, is a set of musical theories that have been influential in my thought…