A Simple Domain-Specific Language
Sinatra takes advantage of Ruby’s elegant syntax to define a simple domain-specific language (DSL) for implementing web applications. Method calls like get, put, and post correspond to the HTTP method of the request. When the method and the URI match, the code block handles the request and returns the result as an HTTP response. This DSL provides an expressive and natural way of developing a web application. Sinatra is particularly well suited to build a server that provides a RESTful API to its clients.
Sinatra is a very lightweight framework with few dependencies. Getting started and developing an application are effortless. Our example will be a bookmarking application: users can save and view their bookmarks, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access