I want to catch 2 similar route in one action block. In Rails5 I can do that easily. I first declare this:
get \':folder/:file\' => \'get#index\', :file =
Example:
desc 'Create transaction'
params do
requires :id, type: String
requires :from_, type: String
end
post ['/:id/addresses/:from_/transactions', '/:id/transactions'] do
end
Routes:
/api/v1/wallets/:id/addresses/:from_/transactions
/api/v1/wallets/:id/transactions
Ok. I've found the answer by trying and looking to refdocs.
get '(:folder/):file', requirements: { folder: /.*/, file: /.*/ } do
This works as expected.