1.0.8 • Published 7 years ago

server-mm v1.0.8

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

##wechat web rebuild team dev tool

###关于我们 http://mmrb.github.io

###安装

npm install --save-dev server-mm

###用例

var server = require("server-mm");

server.start({
    root: __dirname + "/", // 根目录

    port:8080, // 端口

    tmpl: __dirname + "/tmpl.json", // 存放模板参数的文件

    encoding: "utf8", // 项目的默认编码,不填为utf8;
    // 如果页面和默认不一致,可在页面加上<%##encode:gbk##%>来指定读取页面的编码

    fileNotFoundFunc: function(path){ // 当文件没找到时,会调用此方法,用于当本地和线上路径不一致时,修改路径以预览
        return path.replace(/(\/|\\)zh_CN/g, "$1htdocs$1zh_CN");
    }
});

###tmpl.json范例

{
  "projectname": "mmsupport",
  "stationery_path": "/htdocs/zh_CN/",
  "images_path": "/htdocs/zh_CN/htmledition/images/",
  "js_path": "/htdocs/zh_CN/htmledition/js/",
  "css_path": "/htdocs/zh_CN/htmledition/style/",
  "lang": "zh_CN",
  "Language": "zh_CN",
  "retdata": {
      "a": "1",
      "b": "2"
  },

  "GetAllVar": function(arg){return JSON.stringify(this);}
}
1.0.8

7 years ago

1.0.7

9 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago