diff --git a/pom.xml b/pom.xml index 0fc0b3f97..db194e804 100644 --- a/pom.xml +++ b/pom.xml @@ -52,10 +52,6 @@ org.springframework.boot spring-boot-starter-data-jpa - - org.springframework.boot - spring-boot-starter-data-rest - org.springframework.boot spring-boot-starter-jdbc diff --git a/src/main/java/org/springframework/samples/petclinic/rest/RootRestController.java b/src/main/java/org/springframework/samples/petclinic/rest/RootRestController.java new file mode 100644 index 000000000..29f545705 --- /dev/null +++ b/src/main/java/org/springframework/samples/petclinic/rest/RootRestController.java @@ -0,0 +1,43 @@ +/* + * Copyright 2016-2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.samples.petclinic.rest; + +import java.io.IOException; + +import javax.servlet.http.HttpServletResponse; + +import org.springframework.web.bind.annotation.CrossOrigin; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author Vitaliy Fedoriv + * + */ + +@RestController +@CrossOrigin(exposedHeaders = "errors, content-type") +@RequestMapping("/") +public class RootRestController { + + @RequestMapping(value = "/") + public void redirectToSwagger(HttpServletResponse response) throws IOException { + response.sendRedirect("/petclinic/swagger-ui.html"); + } + +} +