Commit 13f7e9dd by Patryk Czarnik

@RestController

parent 6a719bf6
......@@ -2,14 +2,13 @@ package sklep.rest;
import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import sklep.model.Product;
import sklep.repository.ProductRepository;
@Controller
@RestController
public class ProductEndpoint {
private ProductRepository productRepository;
......@@ -18,7 +17,6 @@ public class ProductEndpoint {
}
@GetMapping("/products")
@ResponseBody
public List<Product> getAllProducts() {
System.out.println("puk puk");
return productRepository.findAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment