spring-boot-starter-spa

Zero configuration single page app configuration for spring boot

License

License

Categories

Categories

Spring Boot Container Microservices
GroupId

GroupId

com.github.bgalek.spring.boot
ArtifactId

ArtifactId

spring-boot-starter-spa
Last Version

Last Version

1.1.0
Release Date

Release Date

Type

Type

pom.sha512
Description

Description

spring-boot-starter-spa
Zero configuration single page app configuration for spring boot
Project URL

Project URL

https://github.com/bgalek/spring-boot-starter-spa
Source Code Management

Source Code Management

https://github.com/bgalek/spring-boot-starter-spa

Download spring-boot-starter-spa

Dependencies

compile (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter jar 2.3.1.RELEASE
org.springframework.boot : spring-boot-starter-web jar 2.3.1.RELEASE

Project Modules

There are no modules declared in this project.

Spring Boot Starter - Single Page App

Zero configuration single page app configuration for spring boot

Build Maven Central

Why?

Single Page Apps require one thing: return index.html on HTML request.

Sometimes it's wise to separate your apps (api backend & frontend backend + frontend) - but then you'll have to deal with versioning both aps in compatible way.

For simple use cases it's totally ok to have spring-boot serve your SPA application (build i.e. by webpack).

Spring-boot does not support this feature out of the box. I've found multiple workarounds (404 page filters, manual file checking etc.) and decided to make no-brainer library to handle this problem.

Usage

Add library dependency:

compile "com.github.bgalek.spring.boot:spring-boot-starter-spa:1.1.0"

Copy your fontend application to /public or /static folder during your app build phase.

Compatibility

This configuration won't affect your:

  • API calls (registered Controllers)
  • Existing static files

Versions

Version
1.1.0
1.0.0