ConfigurableApplicationContext application = SpringApplication.run(Application.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");
springboot启动获取ip,端口
最新推荐文章于 2024-08-19 16:01:20 发布