webpro / dyson

Node server for dynamic, fake JSON.
837 stars 61 forks source link

Fake data (FakerJS) #4

Closed webpro closed 11 years ago

webpro commented 11 years ago

@fizerkhan, in #2 you mentioned:

More importantly, the generator code is not enough for fake data. You can use FakerJS https://github.com/marak/Faker.js/

Thanks for the suggestion! I might add it to the project as a dependency. You can actually use it directly yourself, by adding it as a direct (dev)dependency to your project:

var Faker = require('./Faker');
module.exports = {
    path: '/user/:id',
    template: {
        id: function(params) {
            return params.id;
        },
        name: function() {
            return Faker.Name.findName();
        }
    }
}
fizerkhan commented 11 years ago

@webpro Thanks.