No REST for the whippet
Over the past few days I have had the pleasure of standing up and talking about RESTful APIs.
I followed this up with a similar talk on Monday as part of our latest SWmobile meetup, All About APIs in Bath. This time there was no coding - instead I discussed the design of a RESTful API and gave some examples.
The slides for both talks are available here, and the coding tutorial is available on GitHub. For those that enquired, the coding tutorial is split into git tags. Each tag represents a stage of the tutorial, and tags come in twos: a
fail tag and a
pass tag. The idea is to check out each
fail tag as you go, which will checkout a set of (failing) test specs, which you run with
npm test. Have a go at implementing the API and hence ensuring the specs pass (keep running the test suite with
npm test to check your progress). If you get stuck, checkout the corresponding
pass tag to see the answer.
So, for example:
git clone https://github.com/fiznool/no-rest-for-the-whippet.git
git checkout 01a-retrieve-all-fail
... code, code, code ...
git checkout 01b-retrieve-all-pass
git checkout 02-retrieve-by-id-fail
It was great to open the discussion about API design and chat to others after the talks about their experiences designing and building APIs. It became apparent that more and more people are thinking about APIs - pragmatic RESTful principles will certainly help, so I was glad to share some of my own experiences in this area.
I’m looking forward to speaking again soon!