diff --git a/src/main/java/getaguitar/site/demo/Controller/APIController.java b/src/main/java/getaguitar/site/demo/Controller/APIController.java index 5f573f0..c15af8a 100644 --- a/src/main/java/getaguitar/site/demo/Controller/APIController.java +++ b/src/main/java/getaguitar/site/demo/Controller/APIController.java @@ -3,20 +3,17 @@ import getaguitar.site.demo.Dto.ResUserDto; import getaguitar.site.demo.Service.APIService; import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.CrossOrigin; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; @RestController @RequiredArgsConstructor +@CrossOrigin(origins = "*", allowedHeaders = "*", methods = {RequestMethod.GET}) @RequestMapping("/api") public class APIController { private final APIService apiService; @GetMapping("/user") - @CrossOrigin(origins = "*", allowedHeaders = "*") public ResUserDto getUser() throws JsonProcessingException { return apiService.getUser(); } diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 83bc3a2..40aa6cc 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -13,6 +13,6 @@ spring.jpa.show-sql=true spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver # LocalTest -# spring.datasource.url=jdbc:mysql://localhost:3306/getaguitar?useSSL=false&allowPublicKeyRetrieval=true -# spring.datasource.username=root -# spring.datasource.password=8320 \ No newline at end of file +#spring.datasource.url=jdbc:mysql://localhost:3306/getaguitar?useSSL=false&allowPublicKeyRetrieval=true +#spring.datasource.username=root +#spring.datasource.password=8320 \ No newline at end of file