refactornator / spring-boot-livereload-index-controller

A library to serve a provided index thymeleaf template and inject livereload if devtools is enabled

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spring Boot LiveReload Index Controller Maven Central

A simple controller that serves resources/templates/index.html and injects LiveReload when Spring Boot Devtools is included.

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>

About

A library to serve a provided index thymeleaf template and inject livereload if devtools is enabled

License:MIT License


Languages

Language:Java 88.1%Language:HTML 11.9%