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

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.

主站蜘蛛池模板: 厦门市| 北宁市| 多伦县| 墨竹工卡县| 宁河县| 濮阳县| 苏州市| 永济市| 恩平市| 江口县| 喀什市| 永年县| 深泽县| 张家川| 尼木县| 思南县| 泰顺县| 怀来县| 喀喇| 关岭| 西昌市| 莱州市| 松溪县| 盐山县| 丹巴县| 逊克县| 南木林县| 章丘市| 连江县| 柳江县| 克什克腾旗| 镇赉县| 门头沟区| 岚皋县| 正镶白旗| 苍溪县| 龙里县| 达拉特旗| 青浦区| 五华县| 乌鲁木齐县|