text: var fs = require("fs");
  var config = require("./../../app/config");
  var plugin = require("./../../app/plugin");
  
  module.exports = function(req,res){
  	switch (req.params[1]){
  		case undefined:
  			var plugins = plugin.getAll();
  			res.render("setting",{
  				root : config.get('root'),
  				active: "setting",
  				plugins : plugins
  			});
  			break;
  		case "saveRoot":
  			var root = req.query.rootDir;
  			var result = config.setRoot(root);
  			res.jsonp(result);
  			break;
  	}
  }
  