Skip to content

Commit

Permalink
verbose logging when url is rejected for api calls
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricwider committed May 12, 2014
1 parent 42af2b5 commit 2d2b862
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion routes/api_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
class Penelope < Sinatra::Application

before '/api/*' do
halt 404 unless request.path_info =~ /^\/api\/(user)(\/\w+)?$/
unless request.path_info =~ /^\/api\/(user)(\/\w+)?$/
puts "path #{request.path_info} doesn't match /api/user"
halt 404
end
end

get '/api/:thing' do
Expand Down

0 comments on commit 2d2b862

Please sign in to comment.