add multiple cross origin urls in spring boot

In Spring boot there is an annotation @CrossOrigin which will simply add header in the response.

  1. For multiple:
@CrossOrigin(origins = {"http://localhost:7777", "http://someserver:8080"})
@RequestMapping(value = "/abc", method = RequestMethod.GET)
@ResponseBody
public Object doSomething(){
  ...
}
  1. If you wanna allow for everyone then simply use.
@CrossOrigin

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)