0.0.4 • Published 12 years ago

connect-backbone-router v0.0.4

Weekly downloads
2
License
-
Repository
github
Last release
12 years ago

Usage

var Backbone = require("Backbone"),
	connect = require("connect"),
	color = require("colors"),
	connect_backbone_router = require("./../"),
	
	request = require("request");

var app = connect();

var collections = {
	hitchhikers: new Backbone.Collection([
		new Backbone.Model({
			id: 0,
			name: "Zaphod"
		})
	])
};

app.use(connect.logger());
app.use(connect.bodyParser());

app.use(connect_backbone_router({
	debug: true,
	path: "/data",
	collections: collections
}));

app.use(function(req,res,next) {
	res.end("That's all folks!");
});

var server = app.listen(8080);

Now you should be able to get the whole collection at http://localhost:8080/data/hitchhikers

The single model at http://localhost:8080/data/hitchhikers/0

Or an attribute at http://localhost:8080/data/hitchhikers/0/name

0.0.4

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago