Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions src/main/resources/vertx/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,26 @@ http.createHttpClient = function() {
* created.
*
* @example
* var http = require('vertx/http');
* var console = require('vertx/console');
*
* var server = http.createHttpServer();
* server.requestHandler(function(request) {
* var http = require('vertx/http'),
* console = require('vertx/console'),
* server = http.createHttpServer();
*
* server.requestHandler(function (request) {
* var str = '';
* // Get headers from the HttpServerRequest object
* // and write them to the console
* for (var k in request.headers()) {
* console.log(k + ": " + headers[k]);
* }
* // and write them to the console and append to str
* request.headers().forEach(function (k, v) {
* console.log(k + ": " + v);
* str += k + ": " + v + "\n";
* });
*
* request.response.end(str);
*
* }).listen(8080, 'localhost');
* }).listen(8080, 'localhost', function (err) {
* if (!err) {
* console.log('Listen succeeded!');
* }
* });
*
* @class
* @param {org.vertx.java.core.http.HttpServerRequest} request the underlying
Expand Down