Add spring.config.additional-location default config

pull/137/head
johnniang 2019-03-23 22:35:51 +08:00
parent 847828cd14
commit 89a3d76160
2 changed files with 5 additions and 2 deletions

View File

@ -27,6 +27,8 @@ public class Application {
private final static Logger LOG = Logger.getLogger(Application.class);
public static void main(String[] args) {
System.setProperty("spring.config.additional-location", "file:${user.home}/halo/");
// Run application
SpringApplication.run(Application.class, args);
}

View File

@ -86,9 +86,10 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
}
private void printStartInfo() {
String blogUrl = getBlogUrl();
String blogUrl = getBaseUrl();
log.info("Halo started at {}", blogUrl);
// TODO admin may be changeable
log.info("Halo admin is at {}/admin", blogUrl);
if (!haloProperties.getDocDisabled()) {
log.debug("Halo doc enable at {}/swagger-ui.html", blogUrl);
@ -100,7 +101,7 @@ public class StartedListener implements ApplicationListener<ApplicationStartedEv
*
* @return blog url (If blog url isn't present, current machine IP address will be default)
*/
private String getBlogUrl() {
private String getBaseUrl() {
// Get server port
String serverPort = applicationContext.getEnvironment().getProperty("server.port", "8080");