user217648
user217648

Reputation: 3486

Having different Paths in the same Rest API

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

Answers (1)

Alien
Alien

Reputation: 15908

It is possible like below.

@RequestMapping({ "/product/{id}", "/user/{id}" })

Refer multiple-requestmapping-value-with-path-variables

Upvotes: 1

Related Questions