Created
March 23, 2021 08:50
-
-
Save SudhanshuGulhane/05d4b88aebb592a9468b65dcf20f5739 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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