Fake the backend while you develop the frontend

Now all you need is your favorite javascript framework, code editor, and browser.





Step 1.

Create a new project.


These forms are fake! Purely for demonstration.

Step 2.

Define a request for the project.

Step 3.

Add a response to your request.

Step 4.

You'll get a user API key and a project API key. Use those to issue your defined requests to jsonstub.com and get back the responses you've set.



$.ajax({
    type: 'GET',
    url: 'http://jsonstub.com/people',
    beforeSend: function (request) {
        request.setRequestHeader('JsonStub-User-Key', '0b846a85-b69d-42c2-b499-8549d5f50903');
        request.setRequestHeader('JsonStub-Project-Key', 'ade896fc-1749-46c1-a3ff-cb2d10b351e0');
}
}).done(function (people) {
    //do something with the 3 people
});
DS.RESTAdapter.reopen({
    host: 'http://jsonstub.com',
    headers: {
        'JsonStub-User-Key': '0b846a85-b69d-42c2-b499-8549d5f50903',
        'JsonStub-Project-Key': 'ade896fc-1749-46c1-a3ff-cb2d10b351e0'
    }
});
$http({
    url: 'http://jsonstub.com/people',
    method: 'GET',
    headers: {
        'JsonStub-User-Key': '0b846a85-b69d-42c2-b499-8549d5f50903',
        'JsonStub-Project-Key': 'ade896fc-1749-46c1-a3ff-cb2d10b351e0'
}
}).success(function (people, status, headers, config) {
    //do something with the 3 people
});
$ curl http://jsonstub.com/people
    -H "JsonStub-User-Key: 0b846a85-b69d-42c2-b499-8549d5f50903"
    -H "JsonStub-Project-Key: ade896fc-1749-46c1-a3ff-cb2d10b351e0"


Screenshots

Project view

Project View

Request view Define multiple responses for each request. Activate each one as desired.

Request View




© 2014 JsonStub | Support | Twitter