I have a problem with my restful service with spring. Even after enabling CORS, I can not connect to my angled application.
@CrossOrigin
public class UsuarioController {
@Autowired
UsuarioService service;
@RequestMapping(method = RequestMethod.GET, value = "/lista_todos_usuarios", produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Collection<Usuario>> buscaTodosUsuarios() {
Collection<Usuario> usuarios = service.buscaTodosUsuarios();
return new ResponseEntity<>(usuarios, HttpStatus.OK);
}
}
The message below is displayed in the browser console.