maomingchao

在nodejs里面是用类似配置文件的方法

1.a.js 

exports.MYSQLIP = '127.0.0.1';

exports.MYSQLPORT = 1336;


2.b.js

const C = require('./config/config.js');

var HOST = C.MYSQLIP;

var PORT = C.MYSQLPORT;


posted on 2017-02-23 14:21  maomingchao  阅读(114)  评论(0)    收藏  举报

导航