package nl.herpiederpiee.appie_scraper; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import java.util.ArrayList; @Controller public class WebServer { @GetMapping("/") public String index() { return "index"; } @GetMapping("/api/fuzzy") @ResponseBody public ArrayList index(@RequestParam(value = "q", required = true) String fuzzySearch, Model model){ // Call your BonusManager or service to get items ArrayList items = BonusManager.getBonusItems(fuzzySearch); return items; } }