diff --git a/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt b/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt index 261f86eb..3e75161d 100644 --- a/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt +++ b/app/annotation-service/src/main/kotlin/com/group6/annotationservice/controller/AnnotationController.kt @@ -15,13 +15,13 @@ class AnnotationController( private val annotationService: AnnotationService ) { @PostMapping("parse-selector") - @CrossOrigin(origins = ["*"]) + @CrossOrigin(origins = ["*", "http://localhost:3000", "http://game-lounge.com"]) fun parseSelector(@RequestBody selector: SelectorDto): ResponseEntity { return ResponseEntity.ok("test") } @PostMapping("/create") - @CrossOrigin(origins = ["*"]) + @CrossOrigin(origins = ["*", "http://localhost:3000", "http://game-lounge.com"]) fun createAnnotation(@RequestBody annotationDto: AnnotationDto): ResponseEntity { val responseAnnotation = DtoConverter @@ -30,7 +30,7 @@ class AnnotationController( } @GetMapping("/{id}") - @CrossOrigin(origins = ["*"]) + @CrossOrigin(origins = ["*", "http://localhost:3000", "http://game-lounge.com"]) fun getAnnotation(@PathVariable id: String): ResponseEntity { val annotation = annotationService.getAnnotation(id) ?: return ResponseEntity(HttpStatus.NOT_FOUND) @@ -40,7 +40,7 @@ class AnnotationController( } @PostMapping("/get-annotations-by-target") - @CrossOrigin(origins = ["*"]) + @CrossOrigin(origins = ["*", "http://localhost:3000", "http://game-lounge.com"]) fun getAnnotationsByTarget(@RequestBody request: GetAnnotationsByTargetIdRequest): ResponseEntity> { val annotations = annotationService.getAnnotationsByTarget(request.targetId) val responseAnnotationList = annotations.map { DtoConverter.convertAnnotationToAnnotationDto(it) } @@ -48,7 +48,7 @@ class AnnotationController( } @DeleteMapping("/{id}") - @CrossOrigin(origins = ["*"]) + @CrossOrigin(origins = ["*", "http://localhost:3000", "http://game-lounge.com"]) fun deleteAnnotation(@PathVariable id: String): ResponseEntity { return if (annotationService.deleteAnnotation(id)) { ResponseEntity(HttpStatus.NO_CONTENT)