-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prefix doesn't work for base path requests #196
Comments
I'm also seeing this behavior. module Hastur
module API
class V1 < Grape::API
include Hastur::TimeUtil # import all the usec_* methods
include Hastur::API::Constants
helpers Hastur::API::Helpers
# cheeze the version to "api", next version will be "v2"
prefix "api"
format :json
error_format :json
rescue_from :all
# does not return on /api with this version or get "/" do
get do
{
:type => "#{root_uri}/api/type",
:app => "#{root_uri}/api/app",
:node => "#{root_uri}/api/node",
}
end
# SNIP
end
end
end |
I'm seeing the similar behaviour with Grape's "version using path" feature.
I guess "version using path" uses "prefix" under the hood. Namespaces work fine, though, and I guessed they use "prefix" too? |
Fixed on HEAD. This was tricky. A namespaced API call path looks like this in rack-mount: |
This seems to be an issue again. No problem on seems prefix is not being respected on base paths using I did find that setting the prefix value inside the route worked this is not working
this works, but has to be done for each endpoint base segment =(
|
@therocketforever This is a different problem, I opened #867. |
Making a GET request to /myapi will cause a 404.
It works as expected when using a resource block:
The text was updated successfully, but these errors were encountered: