Skip to content

v1 in URL #83

@johnrees

Description

@johnrees

Apologies if I'm missing something extremely obvious. I've dug through https://github.com/filtersquad/rocket_pants/blob/master/lib/rocket_pants/routing.rb and tried using required_prefix, optional_prefix in my routes.rb to no avail.

Purely for vanity reasons I was hoping to have urls like https://api.mydomain.com/v1/objects following the docs I've got to https://api.mydomain.com/1/objects and it works great. So my question is, is there a simple way to add the 'v'?

  constraints subdomain: 'api' do
    get '/' => 'static#api'
    api versions: 1, module: "api/v1" do
      resources :labs, only: [:index]
    end
  end

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions