package lan.zold.emp; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/api") public class UserController { @Autowired UserRepository userRepository; @CrossOrigin @PostMapping("/registry") public User store(@RequestBody User user) { User res = userRepository.save(user); return res; } }