-
Notifications
You must be signed in to change notification settings - Fork 0
docs(about): about ff4j-spring-boot-starters #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,101 @@ | ||
| We know that you are waiting, we will have this section ready very soon. | ||
| # Spring Boot | ||
|
|
||
| FF4j provides Spring Boot starters that help integrate FF4j into a Spring Boot | ||
| application. The starters provide auto-configuration for FF4j, making it easy to set up and use. With | ||
| the starters, you can easily enable or disable features in your application based on the | ||
| configuration of FF4j. | ||
|
|
||
| ## Overview | ||
|
|
||
| FF4j provides two Spring Boot starters: | ||
|
|
||
| - [`ff4j-spring-boot-starter-webmvc`](https://github.com/ff4j/ff4j-spring-boot-starter-parent?tab=readme-ov-file#ff4j-spring-boot-starter-webmvc) - | ||
| The starter for Spring MVC applications. | ||
| - [`ff4j-spring-boot-starter-webflux`](https://github.com/ff4j/ff4j-spring-boot-starter-parent?tab=readme-ov-file#ff4j-spring-boot-starter-webflux) - | ||
| The starter for Spring WebFlux applications. | ||
|
|
||
| | Feature | ff4j-spring-boot-starter-webmvc | ff4j-spring-boot-starter-webflux | | ||
| |-----------------------|:---------------------------------:|:---------------------------------:| | ||
| | RESTful APIs | ✅ | ✅ | | ||
| | OpenAPI Documentation | ✅ | ✅ | | ||
| | Web Console | ✅ | ❌ | | ||
|
|
||
| ## Sample | ||
|
|
||
| ### With `ff4j-spring-boot-starter-webmvc` | ||
|
|
||
| !!! info | ||
|
|
||
| The complete sample is available in the [ff4j-spring-boot-starter-webmvc-sample](https://github.com/ff4j/ff4j-samples/tree/master/ff4j-spring-boot-samples/ff4j-spring-boot-starter-webmvc-sample) | ||
|
|
||
| === "1. Dependency" | ||
|
|
||
| Add the dependency `ff4j-spring-boot-starter-webmvc` | ||
|
|
||
| ```xml title="pom.xml" | ||
| <dependency> | ||
| <groupId>org.ff4j</groupId> | ||
| <artifactId>ff4j-spring-boot-starter-webmvc</artifactId> | ||
| <version>${ff4j.version}</version> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| === "2. Configuration" | ||
|
|
||
| Configure FF4j | ||
|
|
||
| ```kotlin title="FF4JConfiguration.kt" | ||
| import org.ff4j.FF4j | ||
| import org.ff4j.conf.XmlParser | ||
| import org.springframework.context.annotation.Bean | ||
| import org.springframework.context.annotation.Configuration | ||
|
|
||
| @Configuration | ||
| class FF4JConfiguration { | ||
| @Bean | ||
| fun getFF4J(): FF4j = FF4j(XmlParser(), "ff4j-features.xml") | ||
| } | ||
| ``` | ||
|
|
||
| === "3. Bootstrap" | ||
|
|
||
| Run the application with `mvn spring-boot:run` and access the FF4j web console at `http://localhost:8080/ff4j-console` | ||
|
|
||
| ### With `ff4j-spring-boot-starter-webflux` | ||
|
|
||
| !!! info | ||
|
|
||
| The complete sample is available in the [ff4j-spring-boot-starter-webflux-sample](https://github.com/ff4j/ff4j-samples/tree/master/ff4j-spring-boot-samples/ff4j-spring-boot-starter-webflux-sample) | ||
|
|
||
| === "1. Dependency" | ||
|
|
||
| Add the dependency `ff4j-spring-boot-starter-webflux` | ||
|
|
||
| ```xml title="pom.xml" | ||
| <dependency> | ||
| <groupId>org.ff4j</groupId> | ||
| <artifactId>ff4j-spring-boot-starter-webflux</artifactId> | ||
| <version>${ff4j.version}</version> | ||
| </dependency> | ||
| ``` | ||
|
|
||
| === "2. Configuration" | ||
|
|
||
| Configure FF4j | ||
|
|
||
| ```kotlin title="FF4JConfiguration.kt" | ||
| import org.ff4j.FF4j | ||
| import org.ff4j.conf.XmlParser | ||
| import org.springframework.context.annotation.Bean | ||
| import org.springframework.context.annotation.Configuration | ||
|
|
||
| @Configuration | ||
| class FF4JConfiguration { | ||
| @Bean | ||
| fun getFF4J(): FF4j = FF4j(XmlParser(), "ff4j-features.xml") | ||
| } | ||
| ``` | ||
|
|
||
| === "3. Bootstrap" | ||
|
|
||
| Run the application with `mvn spring-boot:run` and access the FF4j web api at `http://localhost:8080/swagger-ui/index.html` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The configuration example is written in Kotlin, but the rest of the docs pages in this section predominantly use Java snippets (e.g.,
docs/pages/about/advanced-concepts/aop/index.md). Consider providing the equivalent Java configuration (or offering both Java/Kotlin tabs) to stay consistent and avoid confusing readers who follow the Java-based examples elsewhere.