Skip to content

Instantly share code, notes, and snippets.

@bensie
Created September 14, 2012 19:09
Show Gist options
  • Select an option

  • Save bensie/3724034 to your computer and use it in GitHub Desktop.

Select an option

Save bensie/3724034 to your computer and use it in GitHub Desktop.
# Any unmatched request within the /api/ namespace should render 404 as JSON
# Stop the request here so that JSON gets returned instead of having it
# run through the whole Rails stack and spit HTML.
get "/*" do
halt_with_404_not_found
end
post "/*" do
halt_with_404_not_found
end
put "/*" do
halt_with_404_not_found
end
patch "/*" do
halt_with_404_not_found
end
delete "/*" do
halt_with_404_not_found
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment