É só usar o jd-gui para ver o código do backend
package br.com.caelum.cdcreact.controllers;
import br.com.caelum.cdcreact.controllers.forms.AutorForm;
import br.com.caelum.cdcreact.daos.AutorDao;
import br.com.caelum.cdcreact.models.Autor;
import javax.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping({"/api/autores"})
@CrossOrigin
public class AutorController
{
@Autowired
private AutorDao autorDao;
@RequestMapping(consumes={"application/json"}, method={org.springframework.web.bind.annotation.RequestMethod.POST})
public Iterable<Autor> salva(@Valid @RequestBody AutorForm autorForm)
{
this.autorDao.save(autorForm.build());
return lista();
}
@RequestMapping(method={org.springframework.web.bind.annotation.RequestMethod.GET}, produces={"application/json"})
public Iterable<Autor> lista()
{
return this.autorDao.findAll();
}
}
Aqui tá a parte do autor que ele já seta o @CrossOrigin