Skip to content

Instantly share code, notes, and snippets.

@tanepiper tanepiper/index.html Secret
Created May 21, 2012

Embed
What would you like to do?
A small airport/seaport/dnode thing that's failing
<html>
<head>
<title>Test</title>
<script src="/dnode.js"></script>
<script>
(function() {
DNode({
clientfoo: function(message) {
console.log(message);
}
}).connect(function(remote, connection){
remote.thing1(5, function(n) {
console.log(n);
});
});
});
</script>
</head>
<body>
</body>
</html>
/* This file sits in thing1/ */
var express = require('express');
var airport = require('airport');
var ports = require('seaport').connect(7070);
var server = express.createServer();
server.configure(function() {
server.use(express.static('./../static'));
});
var air = airport(server);
air({
thing1: function(n, cb) {
cb(n * 10);
}
});
ports.service('thing1', function(port, ready) {
server.listen(port, ready);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.