Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Zero configuration single page app configuration for spring boot
https://github.com/bgalek/spring-boot-starter-spa

angular react single-page-app spa spring spring-boot spring-mvc vue

Last synced: about 1 month ago
JSON representation

Zero configuration single page app configuration for spring boot

Awesome Lists containing this project

README

        

# Spring Boot Starter - Single Page App
> Zero configuration single page app configuration for spring boot

![Build](https://github.com/bgalek/spring-boot-starter-spa/workflows/Java%20CI%20with%20Gradle/badge.svg)
![Maven Central](https://img.shields.io/maven-central/v/com.github.bgalek.spring.boot/spring-boot-starter-spa)

## 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:
```groovy
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