Spring Data REST HAL Browser to check Spring REST operation

Introduction to Spring Data JPA Programming --Amazon says that the REST client of Spring Data REST has HAL Browser, so I will move it.

Preparation

pom.xml


	<parent>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-parent</artifactId>
		<version>2.0.1.RELEASE</version>
	</parent>

	<dependencies>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-rest</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-starter-data-jpa</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework.data</groupId>
			<artifactId>spring-data-rest-hal-browser</artifactId>
		</dependency>
		<dependency>
			<groupId>com.h2database</groupId>
			<artifactId>h2</artifactId>
		</dependency>
	</dependencies>
@RestController
@SpringBootApplication
public class App {
	@RequestMapping("/hoge")
	public String hoge() {
		return "{\"sdfsa\":\"hogehoge\"}";
	}

	public static void main(String[] args) {
		SpringApplication.run(App.class, args);
	}
}

Move

Go to http: // localhost: 8080 /.

springrestdatahal.jpg

However, since the main purpose is to check the operation of HAL of spring-data-rest, it is a delicate place as a general-purpose GUI REST client. As I wrote above, I can access my own `@ RestController``` other than `spring-data-rest```, so I can use it for local operation check ... but I put a dependency for that Is a little subtle.

Recommended Posts

Spring Data REST HAL Browser to check Spring REST operation
How to use Spring Data JDBC
[How to install Spring Data Jpa]
[Introduction to Spring Boot] Form validation check
To write Response data directly in Spring
An introduction to Spring Boot + in-memory data grid
[Spring Batch] Output table data to CSV file
I tried to get started with Spring Data JPA
Introduce swagger-ui to REST API implemented in Spring Boot