Created
August 14, 2012 09:50
-
-
Save xhanin/3347906 to your computer and use it in GitHub Desktop.
Vert.x with Java 8 Lambda
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.vertx.java.core.http.HttpServerRequest; | |
import org.vertx.java.deploy.Verticle; | |
public class Server extends Verticle { | |
@Override | |
public void start() throws Exception { | |
vertx.createHttpServer().requestHandler((HttpServerRequest req) -> { | |
String file = req.path.equals("/") ? "index.html" : req.path; | |
req.response.sendFile(file); | |
}).listen(8086); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment