Skip to content

Instantly share code, notes, and snippets.

@predic8
Created February 7, 2018 14:49
Show Gist options
  • Save predic8/afa90f194a27b903fd8d1e0d4c8abd48 to your computer and use it in GitHub Desktop.
Save predic8/afa90f194a27b903fd8d1e0d4c8abd48 to your computer and use it in GitHub Desktop.
WebFlux main with Netty
public static void main(String[] args) {
ApplicationContext ctx = SpringApplication.run(ReactiveWebApplication.class, args);
HttpHandler handler = WebHttpHandlerBuilder.applicationContext(ctx).build();
ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(handler);
HttpServer.create("localhost", 8080).newHandler(adapter).block();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment