Gem Grape 如何查看生成的 URI?

OrderSun · March 07, 2018 · Last by mico-xiaozhen replied at March 13, 2018 · 1847 hits

配置按照 Grape 的教程,怎么样可以看到这种结果:

GET /api/statuses/public_timeline
GET /api/statuses/home_timeline
GET /api/statuses/:id
POST /api/statuses
PUT /api/statuses/:id
DELETE /api/statuses/:id

Rails 执行rake routes就可以,怎么才能看到 grape api 的呢?

https://gist.github.com/oivoodoo/5089237

不是很好用,到至少能用。

3 Floor has deleted
Reply to yfractal

这个打不开,需要翻墙么?

5 Floor has deleted
Reply to OrderSun

gits 应该要吧, 或者这个 gem https://github.com/syedmusamah/grape_on_rails_routes ?(这个 gem 我没用过)

Reply to yfractal

2 楼的方案挺好的。之前我也看到了,感觉挺麻烦,配置好了确实不错。那个帖子有点老,需要跟新 gem。

gem: grape_on_rails_routes
View Rails-like routes for your Grape API's mounted on Rails

OrderSun closed this topic. 21 Mar 10:15
You need to Sign in before reply, if you don't have an account, please Sign up first.