Spring Boot LiveReload Index Controller
resources/templates/index.html
and injects LiveReload when Spring Boot Devtools is included.
A simple controller that serves Intended to be used in conjunction with gradle-setup-frontend-plugin.
Setup
Available in Maven Central.
<dependency>
<groupId>cool.william.frontend</groupId>
<artifactId>spring-boot-livereload-index-controller</artifactId>
<version>0.0.3</version>
</dependency>
Add an annotation to your main method, along with @SpringBootApplication
@Import(IndexController.class)
See FrontendApplication.java for an example.
This library provides a Spring Boot Controller, so it depends on Spring Boot, specifically Spring Boot Web.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Include Spring Boot Devtools as a dependency to enable LiveReload. LiveReload if a useful development feature that refreshes the browser window your webapp runs in whenever index.html
is modified.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
</dependency>