Skip to content

Commit

Permalink
Adding spring-boot2-webflux-netty example
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasAzar committed Jul 25, 2018
1 parent bbccdb8 commit 09477e9
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 0 deletions.
21 changes: 21 additions & 0 deletions spring-boot2-webflux-netty/.gitignore
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
31 changes: 31 additions & 0 deletions spring-boot2-webflux-netty/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>com.networknt</groupId>
<artifactId>spring-boot2-webflux-netty</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>
</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>
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!");
}
}
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);
}
}

0 comments on commit 09477e9

Please sign in to comment.