21 lines
619 B
Java
Raw Normal View History

2018-01-07 17:05:18 +02:00
package com.baeldung.restdocs;
2016-04-12 23:20:05 -05:00
2016-05-12 00:40:29 -05:00
import static org.springframework.hateoas.mvc.ControllerLinkBuilder.linkTo;
2016-04-12 23:20:05 -05:00
import org.springframework.hateoas.ResourceSupport;
2018-01-07 17:05:18 +02:00
import org.springframework.web.bind.annotation.GetMapping;
2016-04-12 23:20:05 -05:00
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
2016-05-12 00:40:29 -05:00
@RequestMapping("/")
2016-04-12 23:20:05 -05:00
public class IndexController {
2018-01-07 17:05:18 +02:00
@GetMapping
2016-07-26 11:34:56 +03:00
public ResourceSupport index() {
ResourceSupport index = new ResourceSupport();
index.add(linkTo(CRUDController.class).withRel("crud"));
return index;
}
2016-04-12 23:20:05 -05:00
}