优化打包
This commit is contained in:
@@ -24,24 +24,13 @@ import java.util.List;
|
||||
@EnableTransactionManagement
|
||||
public class ExamApplication implements WebMvcConfigurer {
|
||||
|
||||
public static void main(String[] args) throws UnknownHostException {
|
||||
ConfigurableApplicationContext application = SpringApplication.run(ExamApplication.class, args);
|
||||
Environment env = application.getEnvironment();
|
||||
String ip = InetAddress.getLocalHost().getHostAddress();
|
||||
String port = env.getProperty("server.port");
|
||||
String path = env.getProperty("server.servlet.context-path");
|
||||
|
||||
// 未配置默认空白
|
||||
if(path == null){
|
||||
path = "";
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ExamApplication.class, args);
|
||||
log.info("\n----------------------------------------------------------\n\t" +
|
||||
"系统启动成功,访问路径如下:\n\t" +
|
||||
"本地路径: \t\thttp://127.0.0.1:" + port + path + "/\n\t" +
|
||||
"网络地址: \thttp://" + ip + ":" + port + path + "/\n\t" +
|
||||
"API文档: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" +
|
||||
"本地路径: \t\thttp://127.0.0.1:8101\n\t" +
|
||||
"慢sql监控:\t\thttp://127.0.0.1:8101/druid/index.html\n\t"+
|
||||
"API文档: \t\thttp://127.0.0.1:8101/doc.html\n" +
|
||||
"----------------------------------------------------------");
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,16 @@ spring:
|
||||
pool-prepared-statements: true
|
||||
max-open-prepared-statements: 1000
|
||||
async-init: true
|
||||
druid:
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
login-username: admin
|
||||
login-password: admin123
|
||||
web-stat-filter:
|
||||
enabled: true
|
||||
url-pattern: /*
|
||||
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
|
||||
|
||||
# 开启文档
|
||||
swagger:
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
为了方便单文件运行,可以把前端打包文件dist目录的内容复制到本目录下面,这样就可以直接运行jar就包含前端了,不需要单独再部署前端了。
|
||||
访问地址为:http://localhost:8101
|
||||
Reference in New Issue
Block a user