Created
September 5, 2012 09:03
-
-
Save keesun/3633727 to your computer and use it in GitHub Desktop.
Vert.x VS Node.js performance
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
| 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); | |
| } | |
| } |
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
| 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