Skip to content

Instantly share code, notes, and snippets.

@SudhanshuGulhane
Created March 23, 2021 08:50
Show Gist options
  • Save SudhanshuGulhane/05d4b88aebb592a9468b65dcf20f5739 to your computer and use it in GitHub Desktop.
Save SudhanshuGulhane/05d4b88aebb592a9468b65dcf20f5739 to your computer and use it in GitHub Desktop.
@RestController
@RequestMapping("public")
@CrossOrigin(origins = "*", allowedHeaders = "*")
public class PublicEndpoints {
@Autowired
UserService userService;
@GetMapping("/users")
public ResponseEntity<?> getAllUsers() {
List<User> allUsers = userService.getAllUsers();
return ResponseEntity.ok(allUsers);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment