В Синатре можно ли сделать content_type 'application/json' по умолчанию? потому что я пишу API.
content_type 'application/json'
Конечно, добавьте content_type к обратному вызову before:
content_type
before
class MyApp < Sinatra::Base before do content_type 'application/json' end ... end
Sinatra 1.1 вводит сопоставление с образцом перед фильтрами:
before '/admin/*' do check_logged_in end