How to create a REST API for a Ruby application?

前端 未结 4 1117
臣服心动
臣服心动 2021-01-31 00:47

I would like to know how to provide a Ruby application with a REST API. I could code something based on Ruby\'s TCPServer API, but that seems a bit low-level. Do you think it wo

4条回答
  •  别跟我提以往
    2021-01-31 01:13

    For simple REST APIs I would also consider working directly against the Rack library (i.e. you may not need a framework like Sinatra). Routing for example can be quite easy for simple cases. I've put together a little example here: https://gist.github.com/4685445

提交回复
热议问题