Git Product home page Git Product logo

server-mm's Introduction

##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);}
}

server-mm's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.