Skip to content

Instantly share code, notes, and snippets.

@gmoeck
Created April 15, 2011 15:41
Show Gist options
  • Save gmoeck/921905 to your computer and use it in GitHub Desktop.
Save gmoeck/921905 to your computer and use it in GitHub Desktop.
FakeServer.addResourceType('Item', { type: 'Boat' });
FakeServer.addResource('Item', {title: 'Super Boat' });
FakeServer.registerUrl('/something', function(resourceStore){
var items = resourceStore.allOfType('Item');
var response = {
items: items
}
return response;
});
// gives '{"items": [ {"type": "Boat", "title": "Super Boat"} ] }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment