docs: function configureApp(trinte, callback) {
      var app = trinte.app;
      var root = trinte.root;
  
      envConf(app, express);
  
      app.use(multiparty({
          uploadDir: config.parser.uploadDir,
          keepExtensions: config.parser.keepExtensions,
          encoding: config.parser.encoding
      }));
      // parse application/x-www-form-urlencoded
      app.use(bodyParser.urlencoded({extended: true}));
      // parse application/json
      app.use(bodyParser.json());
      // parse application/vnd.api+json as json
      app.use(bodyParser.json({type: 'application/vnd.api+json'}));
      app.use(methodOverride('X-HTTP-Method'));              // Microsoft
      app.use(methodOverride('X-HTTP-Method-Override'));     // Google/GData
      app.use(methodOverride('X-Method-Override'));          // IBM
      app.use(methodOverride('_method')); 	               // simulate DELETE and PUT
      app.use(methodOverride(function (req) {
          if (req.body && typeof req.body === 'object' && '_method' in req.body) {
              // look in urlencoded POST bodies and delete it
              var method = req.body._method;
              delete req.body._method;
              return method;
          }
      }));
      // Accepts json response
      app.use(function (req, res, next) {
          if (req.accepts('json') !== undefined) {
              req.params.format = 'json';
          }
          next();
      });
      app.use(cookieParser(config.session.secret));
      session(app, express);
      // Accepts json response
      app.use(function (req, res, next) {
          if (req.query.language !== undefined || req.query.lang !== undefined) {
              if (req.session) {
                  req.session.language = req.query.language || req.query.lang;
              }
          }
          if (req.session && !req.session.language) {
              req.session.language = config.language;
          }
          next();
      });
      // Before router to enable dynamic routing
      app.use(express.static(root + '/public'));
      // Setup ejs views as default, with .ejs as the extension
      app.set('port', process.env.PORT || config.port);
      app.set('views', root + '/app/views');
      app.engine('ejs', engine);
      app.set('view engine', 'ejs');
      app.set('view options', {
          complexNames: true
      });
      app.use(helper.init(utils));
      app.use(utils.XMLResponse());
      app.use(utils.RSSResponse());
      app.use(utils.ErrorResponse());
      app.use(utils.fixCSRF());
      app.use(flash());
      app.use(locales.translator());
      middleware(app, express);
  
      // Initialize routes params
      require(root + '/config/params')(utils, app);
      callback(app);
  }