@RequestMapping(
            path = "/api",
            method = RequestMethod.GET,
            produces = {"application/hal+json", "application/json"}
    )
    public HalRepresentation getHomeDocument(final HttpServletRequest request) {
        final String homeUrl = request.getRequestURL().toString();
        return new HalRepresentation(
                linkingTo()
                        .self(homeUrl)
                        .single(linkBuilder("search", "/api/products{?q,embedded}")
                                .withTitle("Search Products")
                                .withType("application/hal+json")
                                .build())
                        .build()
        );
    }
@ RequestMapping ( path = "/api" , method = RequestMethod . GET , produces = { "application/hal+json" , "application/json" } ) public HalRepresentation getHomeDocument ( final HttpServletRequest request ) { final String homeUrl = request . getRequestURL ( ) . toString ( ) ; return new HalRepresentation ( linkingTo ( ) . self ( homeUrl ) . single ( linkBuilder ( "search" , "/api/products{?q,embedded}" ) . withTitle ( "Search Products" ) . withType ( "application/hal+json" ) . build ( ) ) . build ( ) ) ; }
Entry point for the products REST API.

@param request current request
@return application/hal+json document containing links to the API.