Skip to content

Instantly share code, notes, and snippets.

@tanepiper
Created May 21, 2012 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanepiper/ad53c212d491167ea544 to your computer and use it in GitHub Desktop.
Save tanepiper/ad53c212d491167ea544 to your computer and use it in GitHub Desktop.
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