官术网_书友最值得收藏!

getAllUsers – mapping

Inside the routingFunction, we will add our first endpoint for getAllUsers. At first, we will keep the null values in the handler to avoid errors in the code:

    return nest (
path("/user"),
nest(
accept(MediaType.ALL),
route(GET("/"), null)
)
);

The preceding nest method will be used to route to the right function, and it will also be used to group other routers. In the preceding method, we use /user in our path and we use GET("/") method as a router. Also, we use MediaType.ALL to accept all media ranges to simplify the code.

主站蜘蛛池模板: 新丰县| 宜宾县| 鸡东县| 荔波县| 会同县| 河曲县| 垦利县| 新营市| 建瓯市| 贺兰县| 龙井市| 湘潭市| 吉隆县| 绥中县| 锡林浩特市| 永城市| 镇沅| 滨海县| 大足县| 达孜县| 楚雄市| 灵寿县| 永善县| 门源| 南雄市| 临安市| 温宿县| 博白县| 宣城市| 东山县| 乡宁县| 元阳县| 新绛县| 宾川县| 准格尔旗| 邯郸市| 越西县| 临沭县| 阳新县| 牙克石市| 花垣县|