0

I'm writing a web service in Ruby which will be consumed by my website, mobile app and other clients. What is the best framework to choose from - Rails, Sinatra, Padrino? I have written Web Application before in Rails but do not have experience writing a Web Service, if there are more resources that can help me understand web service and best practises that will be of great help. Thanks.

Bhushan Lodha
  • 6,824
  • 7
  • 62
  • 100
  • 2
    http://stackoverflow.com/questions/8090644/comparison-between-rails-padrino-and-sinatra – scottxu Nov 05 '14 at 07:13
  • 1
    Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, [describe the problem](http://meta.stackoverflow.com/questions/254393) and what has been done so far to solve it. – the Tin Man Nov 05 '14 at 07:34
  • There is rarely a "best", but often there is a "best fit" - what that is depends very much on details of the project, so there is no canonical answer. If your web service is simple, JSON, RESTful, I would also add [Grape](https://github.com/intridea/grape) to your list of considerations. The different frameworks you want to consider (plus Grape ) are also highly compatible, and can be run together in same rack service with various combinations. – Neil Slater Nov 05 '14 at 10:50

1 Answers1

2

Writing a RESTful API with Sinatra is super easy. Check out the documentation:

get '/foo/:id' do
  .. show something ..
end

post '/foo/new' do
  .. create something ..
end

patch '/foo/:id/edit' do
  .. modify something ..
end

delete '/foo/:id/delete' do
  .. annihilate something ..
end

Padrino and Rails are more appropriate tools for building an entire web application, but if you're just building an API, I would recommend keeping things simple.

Here are a couple of resources you might find helpful:

benjaminjosephw
  • 4,369
  • 3
  • 21
  • 40