Created
August 27, 2012 13:25
-
-
Save keesun/3488388 to your computer and use it in GitHub Desktop.
Sample vert.x module
This file contains hidden or 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
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