Last active
November 14, 2016 06:30
-
-
Save mohan-chinnappan-n/13b33a920734ad874416ee49fafe84f1 to your computer and use it in GitHub Desktop.
Sample Microservice
This file contains 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
module['exports'] = function faker (hook) { | |
var faker = require('faker'); | |
var params = hook.params; | |
var parts = params.property.split('.'); | |
faker.locale = hook.params.locale; | |
var result = faker[parts[0]][parts[1]](); | |
hook.res.end(JSON.stringify(result, true, 2)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment