Permalink
Browse files

more complete example

  • Loading branch information...
1 parent 7c53afa commit 732122dd2b16d94e61f8ae843b9795a577c8da78 @substack committed Apr 22, 2012
Showing with 70 additions and 0 deletions.
  1. +17 −0 README.markdown
  2. 0 bin/cmd.js
  3. +12 −0 example/z/auth.js
  4. +14 −0 example/z/cluster.json
  5. +3 −0 example/z/config.json
  6. +12 −0 example/z/encoder.js
  7. +12 −0 example/z/web.js
View
@@ -46,3 +46,20 @@ zygote --seaport=localhost:7000 push cluster.json
Now there are 2 web, 1 auth, and 3 encoder services running across all your
zygote drones!
+
+Modify the cluster plan and run `zygote push` again to update what all the
+zygote drones are running.
+
+install
+=======
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install zygote
+```
+
+license
+=======
+
+MIT
View
0 bin/cmd.js 100644 → 100755
No changes.
View
@@ -0,0 +1,12 @@
+var http = require('http');
+var seaport = require('seaport');
+var config = require('figc')(__dirname + '/config.json');
+var ports = seaport.connect(config.seaport);
+
+var server = http.createServer(function (req, res) {
+ res.end('auth beep boop');
+});
+
+ports.service('auth', function (port, ready) {
+ server.listen(port, ready);
+});
View
@@ -0,0 +1,14 @@
+{
+ "web" : {
+ "number" : 2,
+ "command" : "node web.js"
+ },
+ "auth" : {
+ "number" : 1,
+ "command" : "node auth.js"
+ },
+ "encoder" : {
+ "number" : 3,
+ "command" : "node encoder.js"
+ }
+}
View
@@ -0,0 +1,3 @@
+{
+ "seaport" : "localhost:7000"
+}
View
@@ -0,0 +1,12 @@
+var http = require('http');
+var seaport = require('seaport');
+var config = require('figc')(__dirname + '/config.json');
+var ports = seaport.connect(config.seaport);
+
+var server = http.createServer(function (req, res) {
+ res.end('encoder beep boop');
+});
+
+ports.service('encoder', function (port, ready) {
+ server.listen(port, ready);
+});
View
@@ -0,0 +1,12 @@
+var http = require('http');
+var seaport = require('seaport');
+var config = require('figc')(__dirname + '/config.json');
+var ports = seaport.connect(config.seaport);
+
+var server = http.createServer(function (req, res) {
+ res.end('web beep boop');
+});
+
+ports.service('web', function (port, ready) {
+ server.listen(port, ready);
+});

0 comments on commit 732122d

Please sign in to comment.