Multiple route pr_mount

Hello,

I am making a plumber api.
the code is split into several .R files (for example endpoint1 to 5), each file being an endpoint.
I would like to group the endpoints in this way

cow/endpoint1
cow/endpoint2
cow/endpoint3
goat/endpoint4
goat/endpoint5

I tried with this code but I feel like the latest endpoint overwrites the previous ones, so I only have
working cow/endpoint3 and goat/endpoint5

#* @plumber
function(pr){
  pr %>%
  pr_mount("/cow",plumb("./endpoint1.R")) %>%  
   pr_mount("/cow",plumb("./endpoint2.R")) %>%  
  pr_mount("/cow",plumb("./endpoint3.R")) %>%  
  pr_mount("/goat",plumb("./endpoint4.R")) %>%  
  pr_mount("/goat",plumb("./endpoint5.R")) %>%  
  
}

thanks for your help :slight_smile:

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.