This file contains 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
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); |
This file contains 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
vertx.createHttpServer().requestHandler(new Handler<HttpServerRequest>() { | |
public void handle(HttpServerRequest req) { | |
String file = req.path.equals("/") ? "index.html" : req.path; | |
req.response.sendFile("webroot/" + file); | |
} | |
}).listen(8080); | |
This file contains 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
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function(){ | |
}); | |
</script> | |
This file contains 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
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet"> | |
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/js/bootstrap.min.js"></script> | |
<!-- optional --> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-responsive.min.css" rel="stylesheet"> | |
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap.no-icons.min.css" rel="stylesheet"> |
This file contains 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
int port = 9090; | |
HttpServer server = vertx.createHttpServer(); | |
SocketIOServer io = new DefaultSocketIOServer(vertx, server); | |
io.sockets().onConnection(new Handler<SocketIOSocket>() { | |
public void handle(final SocketIOSocket socket) { | |
socket.on("timer", new Handler<JsonObject>() { | |
public void handle(JsonObject event) { | |
socket.emit("timer", event); | |
} |
This file contains 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
<script type="text/javascript" src="/socket.io/socket.io.js"></script> | |
<script> | |
var socket = io.connect('http://localhost:9090'); | |
socket.on('news', function (data) { | |
console.log(data); | |
socket.emit('my other event', { my: 'data' }); | |
}); | |
</script> |
This file contains 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
<script src="http://cdn.sockjs.org/sockjs-0.3.min.js"></script> | |
<script> | |
var sock = new SockJS('http://mydomain.com/my_prefix'); | |
sock.onopen = function() { | |
console.log('open'); | |
}; | |
sock.onmessage = function(e) { | |
console.log('message', e.data); | |
}; | |
sock.onclose = function() { |
This file contains 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('Hello World\n'); | |
}).listen(1337, '127.0.0.1'); | |
console.log('Server running at http://127.0.0.1:1337/'); |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>QUnit Test Suite</title> | |
<link rel="stylesheet" href="http://github.com/jquery/qunit/raw/master/qunit/qunit.css" type="text/css" media="screen"> | |
<script type="text/javascript" src="http://github.com/jquery/qunit/raw/master/qunit/qunit.js"></script> | |
<!-- Your project file goes here --> | |
<!--script type="text/javascript" src="myProject.js"></script--> | |
<!-- Your tests file goes here --> | |
<!--script type="text/javascript" src="myTests.js"></script--> |
This file contains 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
ActionScript: source.actionscript.2 | |
AppleScript: source.applescript | |
ASP: source.asp | |
Batch FIle: source.dosbatch | |
C#: source.cs | |
C++: source.c++ | |
Clojure: source.clojure | |
CSS: source.css | |
D: source.d | |
Diff: source.diff |
OlderNewer