Skip to content

Chapter 2 API Versioning #9

@notapatch

Description

@notapatch

Hi madeindjs

Thanks for looking at this book there are very little covering Rails APIs. I couldn't work out this bit on Chapter 2:

Api versioning

At this point we should have a nice routes mapping using a namespace. Your routes.rb file should look like this:

Listing 5. config/routes.rb

Rails.application.routes.draw do
  # Api definition
  namespace :api, defaults: { format: :json }, path: '/'  do     <=== ?
    # We are going to list our resources here
  end
end

The only problem is that the path: '/' has just appeared after the final commit and it's not clear where it came from as it was not in any of the previous listings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions