Skip to content

Commit

Permalink
feature: cors 설정 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
yooooonshine committed Sep 6, 2024
1 parent 24bf593 commit 3a7899b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
Expand Down Expand Up @@ -55,6 +56,7 @@ public ResponseEntity<PostDetailResponse> getPostDetail(@PathVariable("id") Long
}

@Operation(summary = "HTML 코드를 PDF 파일로 변환하는 API")
@CrossOrigin(origins = {"http://localhost:3000", "https://www.chatppt.site", "https://chatppt.site"})
@PostMapping(value = "/pdf", consumes = MediaType.TEXT_HTML_VALUE)
public ResponseEntity<InputStreamResource> generatePdf(@RequestBody String htmlContent)
throws IOException, InterruptedException {
Expand Down

0 comments on commit 3a7899b

Please sign in to comment.