Reputation: 3486
We are using Spring. Is it possible to have different paths in the same REST service. We have one service and we want to have two different endpoints like following in the same REST API. I don't want to follow the best prictices. My question is if it is possible and how? thanks.
http_//domain.com/product/{id}
http_//domain.com/user/{id}
Upvotes: 1
Views: 1538
Reputation: 15908
It is possible like below.
@RequestMapping({ "/product/{id}", "/user/{id}" })
Refer multiple-requestmapping-value-with-path-variables
Upvotes: 1