简体   繁体   English

seedstack,如何从属性文件读取基本URL

[英]seedstack, how to read the base url from properties file

I am using feign client for doing rest call.I kept my base url in application .yaml file. 我正在使用伪装客户端进行休息呼叫。我将基本URL保留在应用程序.yaml文件中。 But I want application.yaml should read the base url from properties file kept in external location. 但是我希望application.yaml应该从保存在外部位置的属性文件中读取基本url。 I am facing this issue when I am trying to do the deployment of my web application. 我在尝试部署Web应用程序时遇到了这个问题。

SeedStack configuration files can contain placeholders (or macros as we call them). SeedStack配置文件可以包含占位符(或称为宏的宏)。 Some runtime information is available under the runtime configuration node and can be referenced using macros. 一些运行时信息在runtime配置节点下可用,并且可以使用宏进行引用。

This is the case for the base URL if you run your Web application with the embedded Web server. 如果使用嵌入式Web服务器运行Web应用程序,则基本URL就是这种情况。 You can refer to it from your properties files regardless of their location: 您可以从属性文件中引用它,而不管它们的位置如何:

someProperty=${runtime.web.baseUrl}/something

Warning : in SeedStack versions older than 18.11, the base URL is available under web.runtime.baseUrl instead. 警告 :在低于18.11的SeedStack版本中,基本URL可以在web.runtime.baseUrlweb.runtime.baseUrl This has been changed in the latest version to regroup all runtime information in the same place. 在最新版本中已对此进行了更改,以将所有运行时信息重新组合到同一位置。 Note that it also had a trailing slash back then. 请注意,那时还带有斜杠。

Relevant docs: 相关文档:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM