Skip to content

Instantly share code, notes, and snippets.

@Marak
Created July 25, 2015 05:47
Show Gist options
  • Save Marak/97f2e74cf7da4f302355 to your computer and use it in GitHub Desktop.
Save Marak/97f2e74cf7da4f302355 to your computer and use it in GitHub Desktop.
hook.io example microservice for generating fake data
// 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