Skip to content

Instantly share code, notes, and snippets.

@keesun
Created September 5, 2012 09:03
Show Gist options
  • Select an option

  • Save keesun/3633727 to your computer and use it in GitHub Desktop.

Select an option

Save keesun/3633727 to your computer and use it in GitHub Desktop.
Vert.x VS Node.js performance
import org.vertx.java.core.Handler;
import org.vertx.java.core.http.HttpServer;
import org.vertx.java.core.http.HttpServerRequest;
import org.vertx.java.deploy.Verticle;
/**
* @author Keesun Baik
*/
public class Test extends Verticle {
@Override
public void start() throws Exception {
HttpServer server = vertx.createHttpServer();
server.requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest request) {
request.response.headers().put("Content-Type", "text/plaun");
request.response.end("hi");
}
});
server.listen(19999);
}
}
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('hi');
}).listen(19999);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment