Blog::App.controllers :posts, map: '/api/v1/posts' do
get :index do
...
end
end
And then, if you want add new versions of that controller
Blog::App.controllers :v2_posts, map: '/api/v2/posts' do
get :index do
...
end
end
(Yeah, it seems you can't have several files with the same controller with different map
values.)
So, this won't work (sorry if that works, that doesn't when I tried) correctly and will cause issues :
Blog::App.controllers :posts, map: '/api/v1/posts' do
get :index do
...
end
end
Blog::App.controllers :posts, map: '/api/v2/posts' do
get :index do
...
end
end