© 2026 Hedgehog Software, LLC
@Configuration public class IngredientRouter { private static final String BASE_URL = "/ingredient/"; @RouterOperations({ @RouterOperation(path = BASE_URL, method = RequestMethod.GET, beanClass = IngredientService.class, beanMethod = "getAllIngredients"), @RouterOperation(path = BASE_URL + "{name}", method = RequestMethod.GET,beanClass = IngredientService.class, beanMethod = "getAllIngredientsStartingWith") }) @Bean public RouterFunction<ServerResponse> ingredientRoute(IngredientHandler handler) { return RouterFunctions .route(GET(BASE_URL).and(accept(MediaType.APPLICATION_JSON)), handler::getAllIngredients) .andRoute(GET(BASE_URL + "{name}").and(accept(MediaType.APPLICATION_JSON)), handler::getAllIngredientsStartingWith); }
Join the Discord to ask follow-up questions and connect with the community
We are a Community full of Java developers. Connect with other devs, get help, help others and do much more!
27,739 Members