How to change the way Spring Boot serves static files?

后端 未结 2 1425
萌比男神i
萌比男神i 2021-01-14 06:50

After using JHipster on a couple of new projects recently (Highly recommended ! Amazing work !), I am trying to back-port some of the concepts into an older webapp, essentia

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-14 07:03

    you can add following code in application.propertise:

    spring.resources.static-locations=classpath:/webapp/
    

    and following code in application.yaml:

    resources:
        static-locations: classpath:/webapp/
    

提交回复
热议问题