-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding spring-boot2-webflux-undertow example
- Loading branch information
1 parent
09477e9
commit de091e9
Showing
4 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
target/ | ||
bower_components/ | ||
node_modules/ | ||
dist/ | ||
.idea/¬¬¬∑ | ||
.tmp/ | ||
.settings | ||
.metadata/ | ||
*.iml | ||
*.log | ||
*.tmp | ||
*.zip | ||
*.bak | ||
dependency-reduced-pom.xml | ||
|
||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml | ||
hs_err_pid* | ||
|
||
.DS_Store | ||
|
||
.idea |
This file contains 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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<project> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>com.networknt</groupId> | ||
<artifactId>spring-boot2-webflux-undertow</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
<parent> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-parent</artifactId> | ||
<version>2.0.0.RELEASE</version> | ||
</parent> | ||
<properties> | ||
<java.version>1.8</java.version> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-webflux</artifactId> | ||
<exclusions> | ||
<exclusion> | ||
<artifactId>spring-boot-starter-reactor-netty</artifactId> | ||
<groupId>org.springframework.boot</groupId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-undertow</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<version>2.0.3.RELEASE</version> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
17 changes: 17 additions & 0 deletions
17
spring-boot2-webflux-undertow/src/main/java/com/networknt/example/Example.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.networknt.example; | ||
|
||
import org.reactivestreams.Publisher; | ||
import org.springframework.stereotype.Controller; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.ResponseBody; | ||
import reactor.core.publisher.Mono; | ||
|
||
@Controller | ||
public class Example { | ||
|
||
@GetMapping("/") | ||
@ResponseBody | ||
public Publisher<String> handler() { | ||
return Mono.just("Hello world!"); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
spring-boot2-webflux-undertow/src/main/java/com/networknt/example/ExampleApplication.java
This file contains 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.networknt.example; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.web.reactive.config.EnableWebFlux; | ||
|
||
@SpringBootApplication | ||
@EnableWebFlux | ||
public class ExampleApplication { | ||
|
||
public static void main(String[] args) throws Exception { | ||
SpringApplication.run(ExampleApplication.class); | ||
} | ||
} |