server/bo_client/server/index.js
author nowmad@nowmads-macbook-pro.local
Thu, 10 Dec 2015 17:00:59 +0100
changeset 49 66739650678f
parent 4 f55970e41793
child 28 b0b56e0f8c7f
permissions -rw-r--r--
update main index to add the 2 kind of menu (hash and history) and set the locationType to hash

// To use it create some files under `mocks/`
// e.g. `server/mocks/ember-hamsters.js`
//
// module.exports = function(app) {
//   app.get('/ember-hamsters', function(req, res) {
//     res.send('hello');
//   });
// };

module.exports = function(app) {
  var globSync   = require('glob').sync;
  var mocks      = globSync('./mocks/**/*.js', { cwd: __dirname }).map(require);
  var proxies    = globSync('./proxies/**/*.js', { cwd: __dirname }).map(require);

  // Log proxy requests
  var morgan  = require('morgan');
  app.use(morgan('dev'));

  mocks.forEach(function(route) { route(app); });
  proxies.forEach(function(route) { route(app); });

};