dorante
Dorante accepts a JSON schema and provides a stub API server based on it.
Install
npm install dorante --save
Usage
Server
Dorante will start a stub API server when you give it a JSON schema. You can then make requests to that server, and Dorante will do its best to act like a real version of the API that the schema represents.
var Dorante = ;var get = get;var dorante; ;
Certain endpoints for the API can also be stubbed:
var appResponse = dorante;dorante;
And unstubbed:
dorante; // or... dorante;
Factories
Dorante can build factories from your JSON schema:
dorante; // {// created_at: '2012-01-01T12:00:00Z',// name : 'example-user'// } dorante; // {// created_at: '2012-01-01T12:00:00Z',// name : 'custom-user-name'// }
It'll also extend nested properties:
dorante; // {// created_at: '2012-01-01T12:00:00Z',// name : 'example-app',// owner : {// created_at: '2012-01-01T12:00:00Z',// name : 'example-user'// }// } dorante; // {// created_at: '2012-01-01T12:00:00Z',// name : 'custom-app',// owner : {// created_at: '2012-01-01T12:00:00Z',// name : 'custom-user'// }// }