This file contains hidden or 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
| <html> | |
| <head> | |
| <title>websocket test</title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| client = new WebSocket("ws://localhost:7000"); | |
| client.onopen = function () | |
| { | |
| console.log("onopen"); |
This file contains hidden or 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 couch = require('node-couchdb/lib/couchdb') | |
| var client = couch.createClient(5984cp,'localhost'); | |
| var db = client.db('server') | |
| db. | |
| saveDoc('score', {name: 'Test', points: 10},function(er,ok) { | |
| if (er) throw new Error(JSON.stringify(er)); | |
| sys.puts("save a document"); | |
| }); |
This file contains hidden or 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 couch = require('node-couchdb/lib/couchdb') | |
| var client = couch.createClient(5984,'localhost'); | |
| var db = client.db('server') | |
| db. | |
| saveDoc('score', {name: 'Test', points: 10},function(er,ok) { | |
| if (er) throw new Error(JSON.stringify(er)); | |
| sys.puts("save a document"); | |
| }); |
This file contains hidden or 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 sys = require('sys') | |
| var couch = require('node-couchdb/lib/couchdb') | |
| var client = couch.createClient(5984,'localhost'); | |
| var db = client.db('server') | |
| function create() | |
| { | |
| db.saveDoc('score', {name: 'Test', points: 10},function(er,ok) { | |
| if (er) throw new Error(JSON.stringify(er)); | |
| sys.puts("save a document"); |
This file contains hidden or 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 sys = require('sys') | |
| var couch = require('node-couchdb/lib/couchdb') | |
| var client = couch.createClient(5984,'localhost'); | |
| var db = client.db('server') | |
| function create() | |
| { | |
| db.saveDoc('score', {name: 'Test', points: 10},function(er,ok) { | |
| if (er) throw new Error(JSON.stringify(er)); | |
| sys.puts("save a document"); |
This file contains hidden or 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 sys = require('sys'); | |
| var ws = require('../vendor/ws/ws'); | |
| //server stuff | |
| var db = require('./models/database') | |
| //start of actual server code. | |
| var server = ws.createServer(); | |
| server.listen(7000); |
This file contains hidden or 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 sys = require('sys') | |
| var couch = require('node-couchdb/lib/couchdb') | |
| var client = couch.createClient(5984,'localhost'); | |
| var db = client.db('server') | |
| var document = | |
| { | |
| names: [], | |
| scores: [] | |
| } |
This file contains hidden or 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
| asdfasdf |
This file contains hidden or 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 sys = require('sys') | |
| var couch = require('node-couchdb/lib/couchdb') | |
| var client = couch.createClient(5984,'localhost'); | |
| var db = client.db('server') | |
| var document = | |
| { | |
| names: [], | |
| scores: [] | |
| } |
This file contains hidden or 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 sys = require('sys') | |
| var couch = require('node-couchdb/lib/couchdb') | |
| var client = couch.createClient(5984,'localhost'); | |
| var db = client.db('server') | |
| var document = | |
| { | |
| names: [], | |
| scores: [], | |
| rev: 0 |