samples/sample3/handlers/employees/{username}/photos/{photoType}.js
function loadMockData(server, next) {
  // Create REST resources for each employee photo
  var resources = [];
  data.employees.forEach(function(employee) {
    var collectionPath = '/employees/' + employee.username + '/photos';
    resources.push(new swagger.Resource(collectionPath, 'portrait', {path: employee.portrait}));
    resources.push(new swagger.Resource(collectionPath, 'thumbnail', {path: employee.thumbnail}));
  });

  // Save the resources to the mock data store
  server.dataStore.save(resources, next);
}
function loadMockData(server, next) {
  // Create REST resources for each employee photo
  var resources = [];
  data.employees.forEach(function(employee) {
    var collectionPath = '/employees/' + employee.username + '/photos';
    resources.push(new swagger.Resource(collectionPath, 'portrait', {path: employee.portrait}));
    resources.push(new swagger.Resource(collectionPath, 'thumbnail', {path: employee.thumbnail}));
  });

  // Save the resources to the mock data store
  server.dataStore.save(resources, next);
}
function loadMockData ( server , next ) { // Create REST resources for each employee photo var resources = [ ] ; data . employees . forEach ( function ( employee ) { var collectionPath = '/employees/' + employee . username + '/photos' ; resources . push ( new swagger . Resource ( collectionPath , 'portrait' , { path : employee . portrait } ) ) ; resources . push ( new swagger . Resource ( collectionPath , 'thumbnail' , { path : employee . thumbnail } ) ) ; } ) ; // Save the resources to the mock data store server . dataStore . save ( resources , next ) ; }
Loads mock employee photo data

@param {SwaggerServer} server
@param {function} next
Loads mock employee photo data