私はrailsアプリケーション、セットアップグレープを使用しており、すべてのエンドポイントを認証しようとしています。だから、grape token auth https://github.com/mcordell/grape_token_authを試して、githubの文書で述べたように設定してください。これらは私の構成です。ブドウトークン認証 "エラー": "404 APIバージョンが見つかりません"
初期化子/ APIのgta.rb
GrapeTokenAuth.setup! do |config|
config.mappings = { user: User }
config.secret = 'aaa'
end
これは私が/ API/V1を/にアクセスするとだから私のルートは
Running via Spring preloader in process 9309
POST /auth/api/v1(/.:format)
DELETE /auth/api/v1(/.:format)
PUT /auth/api/v1(/.:format)
POST /auth/api/v1/sign_in(.:format)
DELETE /auth/api/v1/sign_out(.:format)
GET /auth/api/v1/validate_token(.:format)
GET /auth/confirmation/api/v1(/.:format)
GET /api/v1/statuses/public_timeline(.:format)
のようなものですフォルダ構造
app/api/tmo/api.rb -> mounted two version root file
app/api/tmo/vl/root.rb -> mounted all the other files for v1
app/api/tmo/vl/restaurants.rb -> here lies the mount authentication
include GrapeTokenAuth::MountHelpers
include GrapeTokenAuth::TokenAuthentication
mount_registration(to: '/auth', for: :user)
mount_sessions(to: '/auth', for: :user)
mount_token_validation(to: '/auth', for: :user)
mount_confirmation(to: '/auth', for: :user)
ですステータス/ public_timelineには401が許可されていないので、authenticate_userと表示されます。エラーが起こったりどのように私はこれを解決するのですされた場合
{
"error": "404 API Version Not Found"
}
方法は
作業ですが、私が投稿するときに/ AUTH/API/V1、私は次のエラーを取得するどのように私がチェックしますか?