NodeJs之配置文件管理

查询了一些资料,我使用nodejs的object作为配置文件,首先定义一个module config.js:

var config =
    {
        uploadPath: "E:\"
    };
module.exports = config;

然后在调用出引进该模块:

config = require('config');
uploadDir = config['uploadPath'];
原文地址:https://www.cnblogs.com/eczhou/p/7845537.html