Have you been looking for a thorough, easy to follow guide to building an API using Rails and its new API-only mode?
If so, I recommend checking out Kam Low’s Building the Perfect Rails 5 API Only App
Unlike other tutorials, which can either be too basic or incomplete, this one outlines every step– from generating the initial Rails project all the way to adding authentication and securing the API from malicious attacks. It’s also straightforward to follow along, much like the Michael Hartl Tutorial for learning Rails.
The topics covered are:
- Project setup
- Testing with RSpec
- JSON serialization using
- Enabling cross domain requests using CORS <== this one is huge
- Versioning the API
- Rate limiting, throttling, and other security measures
- Authentication using tokens
By the end of the tutorial you’ll have a fully-functioning API ready to be consumed by a client-side JS framework, native mobile app, or other integration. Check it out!