문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top