Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

jkonowitch/ss-backbone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SS-Backbone

Add to your app.js:

ss.responders.add(require('ss-backbone'));

Backbone models inherit from syncedModel and declare modelname on the class:

myModel = syncedModel.extend( {}, {modelname: "myModel"} );

Backbone collections inherit from syncedCollection and also declare modelname (for now):

myCollection = syncedCollection.extend( {model: myModel}, {modelname: "myModel"} )

On the server [/server/models/mymodel.js]

module.exports = function(ss) {
  	return {
    	create: function(msg, meta, send) {
    		#do stuff
    	},
    	update: function(msg, meta, send) {
    		#do stuff
    	},
    	read: function(msg, meta, send) {
    		#do stuff
    	},
    	delete: function(msg, meta, send) {
    		#do stuff
    	}
    }
}

Check out the (Todo example code) and live app at (http://ss-backbone-example.jit.su/)

About

SocketStream Backbone backend over socket.io

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published