SpringCloud 路由端点
在/routes处的路由端点的GET返回已映射路由的列表:
GET /路线。
{
/stores/**: "http://localhost:8081"
}
可以通过将?format=details查询字符串添加到/routes来请求其他路由详细信息。这样做会产生以下输出:
获取/ routes / details。
{
"/stores/**": {
"id": "stores",
"fullPath": "/stores/**",
"location": "http://localhost:8081",
"path": "/**",
"prefix": "/stores",
"retryable": false,
"customSensitiveHeaders": false,
"prefixStripped": true
}
}
POST至/routes强制刷新现有路由(例如,当服务目录中发生更改时)。您可以通过将endpoints.routes.enabled设置为false来禁用此端点。
路由应该自动响应服务目录中的更改,但是从POST到/routes是强制更改立即进行的一种方法。