diff options
author | terminaldweller <thabogre@gmail.com> | 2022-06-10 05:55:24 +0000 |
---|---|---|
committer | terminaldweller <thabogre@gmail.com> | 2022-06-10 05:55:24 +0000 |
commit | 1ce4b8f49ee9a7611413dd017af47629a535edf5 (patch) | |
tree | c3f4ece2e8d2723bf64c268d4396409149fa994b /src/main/java/com/terminaldweller/doc/DocController.java | |
parent | CORS fix (diff) | |
download | mdrtl-1ce4b8f49ee9a7611413dd017af47629a535edf5.tar.gz mdrtl-1ce4b8f49ee9a7611413dd017af47629a535edf5.zip |
CORS fix
Diffstat (limited to 'src/main/java/com/terminaldweller/doc/DocController.java')
-rw-r--r-- | src/main/java/com/terminaldweller/doc/DocController.java | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/main/java/com/terminaldweller/doc/DocController.java b/src/main/java/com/terminaldweller/doc/DocController.java index a6a1734..53f2748 100644 --- a/src/main/java/com/terminaldweller/doc/DocController.java +++ b/src/main/java/com/terminaldweller/doc/DocController.java @@ -17,7 +17,7 @@ import org.springframework.web.bind.annotation.RestController; /** The document controller class. */ @RestController // @CrossOrigin(origins = {"https://localhost:7080, https://editor.terminaldweller.com"}) -// @CrossOrigin(origins = "https://localhost:7080") +@CrossOrigin(origins = "https://editor.terminaldweller.com", maxAge = 3600) @RequestMapping(path = "api/v1/doc") public class DocController { private final DocService docService; @@ -27,26 +27,22 @@ public class DocController { this.docService = docService; } - @CrossOrigin(origins = "https://localhost:7080") @GetMapping(path = "{Id}") public Optional<Doc> getDocs(@PathVariable("Id") Long id) { return docService.getDocs(id); } - @CrossOrigin(origins = "https://localhost:7080") @PostMapping(path = "{Id}") @ResponseStatus(HttpStatus.CREATED) public void postDocs(@PathVariable("Id") Long id, @RequestBody Doc doc) { docService.addNewDoc(id, doc); } - @CrossOrigin(origins = "https://localhost:7080") @DeleteMapping(path = "{Id}") public void deleteDocs(@PathVariable("Id") Long id) { docService.deleteDoc(id); } - @CrossOrigin(origins = "https://localhost:7080") @PutMapping(path = "{Id}") public void updatDoc(@RequestBody Doc doc, @PathVariable("Id") long id) { docService.updateDoc(doc, id); |