mirror of https://github.com/halo-dev/halo
Add doc tip when starting up
parent
faa616d992
commit
ca78680b3a
|
@ -1,11 +1,14 @@
|
||||||
package cc.ryanc.halo;
|
package cc.ryanc.halo;
|
||||||
|
|
||||||
|
import cc.ryanc.halo.config.properties.HaloProperties;
|
||||||
import cc.ryanc.halo.logging.Logger;
|
import cc.ryanc.halo.logging.Logger;
|
||||||
import cc.ryanc.halo.repository.base.BaseRepositoryImpl;
|
import cc.ryanc.halo.repository.base.BaseRepositoryImpl;
|
||||||
|
import org.springframework.boot.CommandLineRunner;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.cache.annotation.EnableCaching;
|
import org.springframework.cache.annotation.EnableCaching;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
|
||||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
@ -29,10 +32,20 @@ public class Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
// Run application
|
// Run application
|
||||||
ApplicationContext context = SpringApplication.run(Application.class, args);
|
SpringApplication.run(Application.class, args);
|
||||||
// Get server port
|
}
|
||||||
String serverPort = context.getEnvironment().getProperty("server.port");
|
|
||||||
|
|
||||||
LOG.debug("Halo started at http://localhost:" + serverPort);
|
@Bean
|
||||||
|
CommandLineRunner runner(ApplicationContext context, HaloProperties haloProperties) {
|
||||||
|
return args -> {
|
||||||
|
// Get server port
|
||||||
|
String serverPort = context.getEnvironment().getProperty("server.port");
|
||||||
|
|
||||||
|
LOG.debug("Halo started at {}:{}", "http://localhost", serverPort);
|
||||||
|
|
||||||
|
if (!haloProperties.getDocDisabled()) {
|
||||||
|
LOG.debug("Halo doc enable at {}:{}/{}", "http://localhost", serverPort, "swagger-ui.html");
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,11 +58,14 @@ spring:
|
||||||
# 多语言资源文件路径
|
# 多语言资源文件路径
|
||||||
messages:
|
messages:
|
||||||
basename: i18n/messages
|
basename: i18n/messages
|
||||||
|
cache:
|
||||||
|
type: none
|
||||||
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
cc.ryanc.halo: DEBUG
|
cc.ryanc.halo: DEBUG
|
||||||
org.hibernate: ERROR
|
org.hibernate: ERROR
|
||||||
file: ./logs/log.log
|
file: ./logs/log.log
|
||||||
|
|
||||||
halo:
|
halo:
|
||||||
doc-disabled: false
|
doc-disabled: false
|
||||||
|
|
Loading…
Reference in New Issue