1

這是邊緣服務中的.yml文件的一部分。Zuul在傳送微服務器中的一個地方路由

zuul: 
    ignoredServices: /admin 
    routes: 
    user-detail-service: /users/** 
    products-service: /products/** 
    strip-prefix: false 
    prefix: /api 

我使用Eureka服務器進行註冊。現在我可以使用localhost:8082/api/products/products並從products-service獲取數據。有什麼方法可以引用我的服務,如localhost:8082/api/products,並從products-service獲取產品數據。

我已將此鏈接與我的回購https://github.com/ThamiraWeerkoon/ShoppingMall 因爲回購有所有的微服務。

回答

0

您應該將strip-prefix: true置於您的配置中,或者將其留空,因爲true是默認值。

+0

我改變了底部的默認值。這就是爲什麼我改變這個值爲真。現在我編輯它。你現在能理解我的問題嗎? – wthamira

相關問題