How to split things up in a grape api app?

后端 未结 2 556
夕颜
夕颜 2021-02-02 16:19

In every examples I see, people only implement one giant api.rb file. Ex:

  • intridea/grape
  • bloudraak/grape-sample-blog-api
  • djones/grape-goliath-exa
2条回答
  •  不要未来只要你来
    2021-02-02 17:14

    I found it not working for path prefix:

    mount Blog::Post => '/blog'
    

    doesn't work if you want have prefix the path.

    use

    namespace :blog do
       mount Blog::Post
    end
    

    Hope it helps!

提交回复
热议问题