首页>代码>SpringBoot开发网站后台管理系统>/springboot-mini/src/main/java/com/zyxx/SpringBootMiniApplication.java
package com.zyxx;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import springfox.documentation.spring.web.SpringfoxWebMvcConfiguration;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * 项目启动类
 *
 * @EnableCaching 启用了缓存机制
 * 开放了接口文档静态资源
 * @Author Lizhou
 */
@Slf4j
@SpringBootApplication
@EnableCaching
public class SpringBootMiniApplication {

    public static void main(String[] args) throws UnknownHostException {
        ConfigurableApplicationContext application = SpringApplication.run(SpringBootMiniApplication.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");
        log.info("\n----------------------------------------------------------\n\t" +
                "Application Declare is running! Access URLs:\n\t" +
                "Local: \t\thttp://localhost:" + port + path + "/\n\t" +
                "External: \thttp://" + ip + ":" + port + path + "/\n\t" +
                "Swagger-UI: \t\thttp://" + ip + ":" + port + path + "/doc.html\n" +
                "----------------------------------------------------------");
    }
}
最近下载更多
15578157792  LV7 2024年10月24日
Tomcat80  LV5 2024年8月14日
9605451tjb  LV4 2024年8月7日
TY0165  LV20 2024年6月18日
llllllK  LV5 2024年5月13日
Luck_ZDM  LV12 2024年4月12日
13521878735  LV3 2024年3月26日
森sdfgf  LV8 2024年2月8日
skook7  LV2 2023年12月14日
qwerdf963  LV3 2023年11月20日
最近浏览更多
哪里的完整版  LV8 2月26日
Boss绝  LV9 1月27日
ma406805131  LV19 2024年12月19日
wjh007  LV5 2024年12月17日
sjwc88  LV3 2024年12月4日
王愉悦  LV4 2024年12月3日
haomc052829  LV4 2024年12月3日
shaohuaqingfu  LV3 2024年11月6日
15578157792  LV7 2024年10月24日
bluerstar  LV1 2024年10月23日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友