Skip to content

Commit

Permalink
Fixed Can't access HTTP request body in java11-vert-x template. openf…
Browse files Browse the repository at this point in the history
…aas#255

Signed-off-by: Patrik Fortier <[email protected]>
  • Loading branch information
p-fortier committed Apr 3, 2021
1 parent ab88a26 commit d3c8998
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import io.vertx.core.Vertx;
import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import io.vertx.ext.web.handler.BodyHandler;
import io.vertx.ext.web.handler.StaticHandler;
import java.util.Optional;

Expand All @@ -16,6 +17,7 @@ public static void main(String[] args) throws Exception {
HttpServer server = vertx.createHttpServer();
Router router = Router.router(vertx);

router.route().handler(BodyHandler.create());
if (Boolean.parseBoolean(Optional.ofNullable(System.getenv("FRONTAPP")).orElse("false"))) {
// serve static assets, see /resources/webroot directory
router.route("/*").handler(StaticHandler.create());
Expand Down

0 comments on commit d3c8998

Please sign in to comment.