Skip to content

Instantly share code, notes, and snippets.

@CharlieKuharski
Last active August 28, 2015 04:46
package vertxio.demo;
import io.vertx.core.AbstractVerticle;
public class MyDemo extends AbstractVerticle{
public void start(){
vertx.createHttpServer()
.requestHandler( req -> {
String file = "C:/temp/dummy.txt";
req.response()
.putHeader("content-type", "text/plain")
.sendFile(file)
.setStatusCode(200)
.setStatusMessage("Sent: "+file);
}).listen(8080);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment