Ejemplo n.º 1
0
exports.initRoutes = function (app) {
  var restServicePath = config.applicationPaths().restServicePath;

  return api.init(app, {
    prefix: restServicePath + 'git',
    tmpDir: path.join(os.tmpdir(), 'git-temp-dir'),
  });
};
Ejemplo n.º 2
0
exports.initRoutes = function (app) {
  var io;
  var restServicePath = config.applicationPaths().restServicePath;

  console.log('initializing code-review api:', restServicePath);
  app.get(restServicePath + 'pull-requests', getByFilter);
  app.post(restServicePath + 'pull-requests', insert);
  app.get(restServicePath + 'pull-requests/:id/comments', showComments);
  app.post(restServicePath + 'pull-requests/:id/comments', addComments);
  app.put(restServicePath + 'pull-requests/:id/state', setState);

  io = app.get('io').of('/pull-requests');
  io.authorization(ioAuthorization);
  io.on('connection', ioOnConnect);
};