From 964d00963e409bb83d56d6728b1e515616f1c349 Mon Sep 17 00:00:00 2001 From: James Halliday Date: Thu, 9 Feb 2012 01:26:51 -0800 Subject: [PATCH] updated the service example with secret and semver --- README.markdown | 8 ++++---- example/service/client.js | 4 ++-- example/service/server.js | 4 ++-- package.json | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.markdown b/README.markdown index 7bc8472..c03b897 100644 --- a/README.markdown +++ b/README.markdown @@ -24,14 +24,14 @@ server.js: ``` js var seaport = require('seaport'); -var ports = seaport.connect('localhost', 9090); +var ports = seaport.connect('localhost', 9090, { secret : 'beep boop' }); var http = require('http'); var server = http.createServer(function (req, res) { res.end('beep boop\r\n'); }); -ports.service('http server', function (port, ready) { +ports.service('web@1.2.3', function (port, ready) { server.listen(port, ready); }); ``` @@ -42,10 +42,10 @@ client.js: ``` js var seaport = require('seaport'); -var ports = seaport.connect(9090); +var ports = seaport.connect(9090, { secret : 'beep boop' }); var request = require('request'); -ports.get('http server', function (ps) { +ports.get('web@1.2.x', function (ps) { var u = 'http://' + ps[0].host + ':' + ps[0].port; request(u).pipe(process.stdout); }); diff --git a/example/service/client.js b/example/service/client.js index 014df0f..a205600 100644 --- a/example/service/client.js +++ b/example/service/client.js @@ -1,8 +1,8 @@ var seaport = require('../../'); -var ports = seaport.connect('localhost', 9090); +var ports = seaport.connect('localhost', 9090, { secret : 'beep boop' }); var request = require('request'); -ports.get('http', function (ps) { +ports.get('web@1.2.x', function (ps) { var u = 'http://' + ps[0].host + ':' + ps[0].port; request(u).pipe(process.stdout); }); diff --git a/example/service/server.js b/example/service/server.js index cc3804e..7d0332f 100644 --- a/example/service/server.js +++ b/example/service/server.js @@ -1,11 +1,11 @@ var seaport = require('../../'); -var ports = seaport.connect('localhost', 9090); +var ports = seaport.connect('localhost', 9090, { secret : 'beep boop' }); var http = require('http'); var server = http.createServer(function (req, res) { res.end('beep boop\r\n'); }); -ports.service('http', function (port, ready) { +ports.service('web@1.2.3', function (port, ready) { server.listen(port, ready); }); diff --git a/package.json b/package.json index 0e70eeb..85a30a5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name" : "seaport", "description" : "service registry and port assignment for clusters", - "version" : "0.4.1", + "version" : "0.5.0", "repository" : { "type" : "git", "url" : "git://github.com/substack/seaport.git"