Skip to content

JackCA/geronte

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

Install

bower install geronte --save

Usage

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();

About

client-side API stub from a JSON schema

Resources

Stars

Watchers

Forks

Packages

No packages published