Changing default URL mapping for Serving Static Content in Spring Boot

后端 未结 5 1680
鱼传尺愫
鱼传尺愫 2021-01-19 13:29

My static resources stopped working as soon as I added a new Controller (non rest) in my application with the following mapping

@RequestMapping(value = \"/{p         


        
5条回答
  •  不知归路
    2021-01-19 14:14

    I added spring.resources.static-location=file:../frontend/build in application.properties

    index.html is present in the build folder

    Use can also add absolute path

    spring.resources.static-location=file:/User/XYZ/Desktop/frontend/build

提交回复
热议问题