Skip to content

Jumboweb/grape-device-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grape-device-sample

Accessing Grape routes

Add this code in : lib/tasks/routes.rake

namespace :api do
  desc "API Routes"
  task :routes => :environment do
    GrapeDeviceSample::Base.routes.each do |api|
      method = api.route_method.ljust(10)
      path = api.route_path.gsub(":version", api.route_version)
      puts "     #{method} #{path}"
    end
  end
end

Now, run this task and it should print routes :

rake api:routes
 GET        /api/v1/users
 GET        /api/v1/users/:id
 POST       /api/v1/users
 PUT        /api/v1/users/:id
 POST       /api/v1/users/signin

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published