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

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.

主站蜘蛛池模板: 扶余县| 林西县| 栾城县| 永和县| 武安市| 宜城市| 昂仁县| 布尔津县| 青冈县| 抚顺市| 北碚区| 长岛县| 庆云县| 东丽区| 莱阳市| 赤水市| 孟州市| 萨嘎县| 太保市| 开阳县| 彭山县| 大同市| 衡东县| 大冶市| 娄底市| 锡林郭勒盟| 铜梁县| 周至县| 都江堰市| 上虞市| 象山县| 渭南市| 永丰县| 慈利县| 高平市| 潼关县| 微山县| 河东区| 巍山| 增城市| 获嘉县|