Using RepositoryRestResource annotation to change RESTful endpoint not working
I am new to Spring boot. I was trying to create RESTful web service which also plugs into MongoDB. Everything works fine as the guide explains except for this.
package hello.requests;
import java.util.List;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import hello.models.CustomerModel;
@RepositoryRestResource(collectionResourceRel = "people", path = "people")
public interface CustomerRepository extends MongoRepository<CustomerModel, String> {
List<CustomerModel> findByLastName(@Param("name") String name);
}
Here I am trying to change the RESTful endpoint for the repository from the default to . But when I run this, I get 404 if I try but works fine for .
In a broader sense how does work?
What am I doing wrong here?/customerModels
/people
/people
/customerModels
@RepositoryRestResource