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

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.

主站蜘蛛池模板: 会同县| 蒲江县| 怀安县| 铜鼓县| 高密市| 金山区| 信宜市| 秦皇岛市| 静乐县| 永泰县| 伊宁县| 通山县| 汾阳市| 阿拉尔市| 民权县| 兖州市| 锡林浩特市| 岳西县| 牙克石市| 合江县| 宜阳县| 繁峙县| 唐河县| 西和县| 郎溪县| 开江县| 文安县| 福鼎市| 通江县| 克东县| 呈贡县| 正镶白旗| 和硕县| 丰原市| 三都| 大田县| 邹城市| 浦城县| 苍南县| 怀宁县| 鄂伦春自治旗|