I am new to Spring Boot and I am trying to add a simple html page for my project At the moment, my project's structure is the following:
Having read the following: https://spring.io/blog/2013/12/19/serving-static-web-content-with-spring-boot
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-static-content
and other answers in StackOverflow, I'd expect to see the contents of index.html when I visit http://localhost:8080/
What could I be missing?
As there is no webapp in SpringBoot project , we can place the html files in either in
src/main/resources/resources/index.html
src/main/resources/static/index.html
src/main/resources/public/index.html
Remember the above is in highest to lowest precedence.
To check your file run the main class in eclipse and go to http://localhost:8080/index.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With