Git Product home page Git Product logo

bird's Introduction

bird

一个提供了代理和数据mock功能,同时支持php、jsp静态语法解析的文件资源服务器,配置方便,对前端开发提供本地化webserver环境的支持。

主要功能:

  1. webserver
  2. php、jsp的支持
  3. proxy代理
  4. 数据模拟

使用说明:

1.将代码clone到本地

git clone https://github.com/weger/bird

2.修改配置文件

//静态服务器配置,可同时配置多个,域名需host到127.0.0.1
exports.Server = {
    "8081": {
        //静态文件根目录
        "basePath": "/Users/zhang/projects/webroot",
        // 是否开启调试模式,true(表示server端不缓存),false(反之)
        "debug": true,
        //忽略的静态文件请求,与此正则匹配的请求将直接走转发规则(可选配置)
        "ignoreRegExp":  /\/js\/urls\.js/g
    }
};
//转发规则——静态服务器没有响应的或者忽略的请求将根据一下规则转发
exports.TranspondRules = {
    "8081": {
        //目标服务器的ip和端口,域名也可,但注意不要被host了
        targetServer: {
            "host": "10.44.67.14",
            "port": "8045"
        },
        //特殊请求转发,可选配置,内部的host、port和attachHeaders为可选参数
        regExpPath: {
            "/hrlms/rs": {
                //"host": "10.44.67.14",
                //"port": "8045",
                //"attachHeaders": {"app-id": 5},
                "path": "/hrlms/rs"
            }
        }
    },
    "ajaxOnly": false
};

3.执行命令

node app

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.