1
我正在配置我的鐵軌葡萄應用搖頭擺尾。我有葡萄工作的權利。昂首闊步葡萄文件被創建招搖不搖葡萄
但是當我去招搖URL它顯示
fetching resource list: http://localhost:3000/api/api_docs.json
這是我api.rb文件
class API < Grape::API
format :json
formatter :json, Grape::Formatter::ActiveModelSerializers
before do
header["Access-Control-Allow-Origin"] = "*"
header["Access-Control-Request-Method"] = "*"
unless Rails.env.test?
log = Rails.logger
log.info [request.env["REQUEST_METHOD"], request.env["REQUEST_PATH"]]
log.info request.body.read
end
end
mount Kodomo::Status
base_path_proc = Proc.new do |r|
if Rails.env.development?
"http://#{r.host}:#{r.port}"
else
"http://#{r.host}"
end
end
add_swagger_documentation mount_path: "api_docs",
api_version: "v4",
hide_documentation_path: true,
hide_format: true,
base_path: base_path_proc
end
的/ API/API-docs的是生成正確,所以我不知道這可能是。
感謝您的幫助