Geront takes a JSON schema and uses Dorante and Pretender to create a client-side-only stub of an API. Currently, it's only tested against the Heroku JSON API schema.
bower install geronte --save
Create a new instance of Geronte and set up the default request handlers based on the links in your API schema:
var geronte = new Geronte(apiSchema);
geronte.setupRequestHandlers();
Add some custom factories and request handlers:
geronte.daronte.defineFactory('foo', { bar: 'baz' });
geronte.createStub('GET', '/foos', [geronte.daronte.factory('foo')]);
Reset the custom request handlers (but leave custom factories alone):
geronte.reset();
Shut down the Geronte server and return XMLHTTPRequest
to normal:
geronte.shutdown();