Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d1da171

Browse files
authored
Add CORS support for specific origins in TaskController
1 parent 7536271 commit d1da171

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

java-api/src/main/java/com/java_api/java_api/controller/TaskController.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
import java.util.Optional;
1414

1515
@RestController
16+
@CrossOrigin(origins = {
17+
"https://danielvor.onrender.com",
18+
"https://seu-app.vercel.app",
19+
"http://localhost:3000"
20+
})
1621
@RequestMapping("/api/tasks")
1722
public class TaskController {
1823

@@ -76,4 +81,4 @@ public ResponseEntity<HttpStatus> deleteTask(@PathVariable String id) {
7681
return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
7782
}
7883
}
79-
}
84+
}

0 commit comments

Comments
 (0)