How to create two routes in one block in grape?

前端 未结 2 1396
迷失自我
迷失自我 2021-01-16 01:42

I want to catch 2 similar route in one action block. In Rails5 I can do that easily. I first declare this:

get \':folder/:file\' => \'get#index\', :file =         


        
2条回答
  •  说谎
    说谎 (楼主)
    2021-01-16 02:16

    Ok. I've found the answer by trying and looking to refdocs.

    get '(:folder/):file', requirements: {  folder: /.*/, file: /.*/ } do
    

    This works as expected.

提交回复
热议问题