Question

I have a Rails web app and I want to provide API. I have found Grape and it looked nice and it can also be mounted into Rails but I am not sure of benefits of mounting Grape into my Rails app and use it for API instead of Rails controllers.

As I understand Grape is great for building applications that provide only API but it is not my case.

What do you think are the benefits of using Grape in the Rails app and why should I do so?

Was it helpful?

Solution

Grape within Rails makes it easy to standardize the syntax of your API.

For example, parameter validation and coercion, error handling specific to your API that's different than what Rails provides out of the box, and easy shortcuts for typical responses.

You could do all this with Rails, of course. Grape just makes it easy.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top