text: var path     = require('path')
  var express  = require('express')
  var cookieParser = require('cookie-parser');
  var session = require('cookie-session');
  var bodyParser = require('body-parser');
  var methodOverride = require('method-override')
  
  module.exports = function (app) {
  
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(cookieParser());
  app.use(express.query());
  app.use(bodyParser.urlencoded({'extended':'true'}));
  app.use(bodyParser.json({type:'application/vnd.api+json'}));
  app.use(methodOverride());
  app.use(session({keys: ['jsadmin1', 'jsadmin2', '...'],cookie:{maxAge:36000000000}}));
  // 10000 hour
  
  app.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Credentials",true);
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  });
  
  }
  