Springboot项目访问静态资源
在application.yml中新增配置 :
spring.mvc.static-path-pattern: /static/**
在resources目录下添加目录static,将静态资源放入后即可通过地址访问。若放入index.html文件,那么访问:http://ip:port/xxx/static/index.html。
在application.yml中新增配置 :
spring.mvc.static-path-pattern: /static/**
在resources目录下添加目录static,将静态资源放入后即可通过地址访问。若放入index.html文件,那么访问:http://ip:port/xxx/static/index.html。