var
  config     = require('./config'),
  mocks      = require('./routes/mocks'),
  help       = require('./lib/routeHelpMessage'),
  components = require('./routes/components');

module.exports = function (app) {

  app.get('/', function (req, res) {
    res.json(help);
  });

  app.get('/components', components.index);
  app.get('/components/:owner/:name', components.show);
  app.get('/components/:owner/:name/script.js', components.getScript);
  app.get('/components/:owner/:name/build.js', components.getBuild);

  app.use(function (err, req, res, next) {
    res.send(err.code || 500, { error: err.message });
  });

  if (config.isTest) {
    app.get('/mock/registry', mocks.registry);
  }
};

@@ -208,16 +208,311 @@
 app) %7B%0A%0A
+  app.all('*', function(req, res, next)%7B%0A    res.set('Access-Control-Allow-Origin', '*');%0A    res.set('Access-Control-Allow-Methods', 'GET');%0A    res.set('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type');%0A    if ('OPTIONS' == req.method) return res.send(200);%0A    next();%0A  %7D);%0A%0A
   app.ge

Add CORS support