Skip to content

Instantly share code, notes, and snippets.

@keesun
Created August 27, 2012 13:25
Show Gist options
  • Save keesun/3488388 to your computer and use it in GitHub Desktop.
Save keesun/3488388 to your computer and use it in GitHub Desktop.
Sample vert.x module
package me.whiteship;
import org.vertx.java.core.Handler;
import org.vertx.java.core.http.HttpServer;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.core.http.HttpServerResponse;
import org.vertx.java.deploy.Verticle;
/**
* @author Keesun Baik
*/
public class HelloVertxModule extends Verticle {
@Override
public void start() throws Exception {
HttpServer server = vertx.createHttpServer();
server.requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest request) {
request.response.end("Hello Vert.x");
}
});
System.out.println("server is running on http://localhost:9090/");
server.listen(9090);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment