Created
July 25, 2015 05:47
-
-
Save Marak/97f2e74cf7da4f302355 to your computer and use it in GitHub Desktop.
hook.io example microservice for generating fake data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple microservice for generating fake data | |
// faker.js docs - http://github.com/marak/faker.js | |
module['exports'] = function fakeData (hook) { | |
var faker = require('faker'); | |
// supports multiple locales | |
faker.locale = 'en'; // try: 'de', 'es' | |
// supports all faker.js methods | |
var result = faker.name.findName(); | |
hook.res.end(result); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment