/**
 * MainController
 *
 * @module		:: Controller
 * @description	:: Contains logic for handling requests.
 */

module.exports = {
  /**
   * Index page route /
   */
  index: function(req, res) {
    var we = req.getWe();

    res.locals.template = 'home/index';
    res.view({ title: we.config.appName });
  },

  /**
   * Client side configs
   * @param  {object} req
   * @param  {object} res
   */
  getConfigsJS: function(req, res) {
    var we = req.getWe();

    // set header to never cache this response
    res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
    res.header('Expires', '-1');
    res.header('Pragma', 'no-cache');

    var configs = we.getAppBootstrapConfig(we);

    return res.send(configs);
  },

  getRoutes: function(req, res) {
    var we = req.getWe();
    var getRoutes = {};
    var url;

    for(var routePath in we.routes) {
      if (routePath.substring(0, 4) === 'get ' && we.routes[routePath].responseType != 'json') {
        url = routePath.replace('get ', '');
        getRoutes[url] = we.routes[routePath];
      }
    }

    res.send(getRoutes);
  }
};
@@ -217,24 +217,50 @@
 etWe();%0A%0A   
+ if (!res.locals.template)
  res.locals.
@@ -284,16 +284,17 @@
 index';%0A
+%0A
     res.

update main index template