1
0
This commit is contained in:
Jose
2025-03-03 00:35:08 +01:00
parent 5d60d96567
commit 60de5de296
9 changed files with 131 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package net.miarma.contaminus;
import io.vertx.core.AbstractVerticle;
import io.vertx.core.Promise;
public class Main extends AbstractVerticle {
@Override
public void start(Promise<Void> startFuture) {
vertx.createHttpServer().requestHandler(r -> {
String file = r.path().equals("/") ? "index.html" : r.path().substring(1);
r.response().sendFile("webroot/" + file);
}).listen(80, result -> {
if (result.succeeded()) {
startFuture.complete();
} else {
startFuture.fail(result.cause());
}
});
}
}

View File

@@ -0,0 +1,10 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Vert.X test</title>
</head>
<body>
<h1>Vert.X test</h1>
<p>Hola</p>
</body>
</html>