1
0

Re-moved webroot to src/main/resources

This commit is contained in:
Jose
2025-03-12 21:52:45 +01:00
parent 8e9494c5ce
commit b5561dea70
13 changed files with 857 additions and 20 deletions

View File

@@ -13,24 +13,27 @@ public class HttpServerVerticle extends AbstractVerticle {
Constants.LOGGER.info("🟢 Iniciando HttpServerVerticle...");
Router router = Router.router(vertx);
router.route("/*").handler(StaticHandler.create(Constants.BASE_DIR + "/webroot")
.setDefaultContentEncoding("UTF-8"));
router.route("/*")
.handler(
StaticHandler.create("webroot")
.setDefaultContentEncoding("UTF-8")
);
router.route("/dashboard/*").handler(ctx -> {
ctx.reroute("/index.html");
});
vertx.createHttpServer().requestHandler(router).listen(
Host.getWebserverPort(), Host.getHost(), result -> {
if (result.succeeded()) {
Constants.LOGGER.info(String.format("📡 HttpServerVerticle desplegado. (http://%s:%d)",
Host.getHost(), Host.getWebserverPort())
);
} else {
Constants.LOGGER.error("❌ Error al desplegar HttpServerVerticle", result.cause());
}
});
Host.getWebserverPort(), Host.getHost(), result -> {
if (result.succeeded()) {
Constants.LOGGER.info(String.format("📡 HttpServerVerticle desplegado. (http://%s:%d)",
Host.getHost(), Host.getWebserverPort())
);
} else {
Constants.LOGGER.error("❌ Error al desplegar HttpServerVerticle", result.cause());
}
}
);
}
}