Hosted backbone server

Written by Liam McLennan

This morning I published my zero-config backbone.js server.

It is an in-memory, restful server that implements the protocol required by Backbone.js, which is basically the same as couchdb except that ‘create’ returns the new id. As such it can be used for any purpose requiring temporary resource persistence. The service provides no durability at all. If it restarts all of the data is lost.

I’m now running a public instance at It works on my machine, don’t blame me if it crashes your space shuttle. No warranty of any kind. Obviously.

To use with backbone set your model or collection’s url property to[yourresourcetype]. Have a look at this jsfiddle. If you run the example and look in Chrome’s developer tools networking tab you will see:


POST /books HTTP/1.1


HTTP/1.1 200 OK
X-Powered-By: Express

{"title":"Midnight in the garden of good and evil","author":"John Berendt"}

The model is persisted to the hosted backbone server.

The set of supported operations (which match those required by backbone.js) is:


$ curl -X POST -H "Content-Type: application/json" -d '{"name": "Bob", "age":"28"}'

=> {id: 1}


Bob had a birthday

$ curl -X PUT -H "Content-Type: application/json" -d '{"name": "Bob", "age":"29", "id": 1}'

=> OK

Read the Collection

$ curl -H "Content-Type: application/json"

=> [{"name":"Jane","age":"32","id":0},{"name":"Bob","age":"29", "id":1}]

Read a Resource

$ curl -H "Content-Type: application/json"

=> {"name":"Bob","age":"29", "id":1}


$ curl -X DELETE -H "Content-Type: application/json"

=> OK