hanCodeHub
3/14/2020 - 1:46 AM

Initialize Spring Project

  1. Go to https://start.spring.io/
  2. Add Spring Web dependency
  3. Create REST controllers like the one in this snippet
@RestController
public class BooksController {

    @GetMapping("/books")
    public List<Book> getAllBooks() {
        return Arrays.asList(
                new Book(1, "Learning Java", "Han")
        );
    }

}