http-server-dev

1.0.11 • Public • Published

http-server-dev

基于nodejs实现的http服务器,用于开发环境,支持反向代理

Why

做单页面应候需要搭建http服务器,之前一直用grunt,gulp的http插件,后来有了webpack,基本不用grunt,gulp这些工具,转向npm script,为了开发便利,基于express开发了这款http服务器,方便大家使用!

Install

npm install http-server-dev

Command

npm install -g http-server-dev   
http-server-dev

Script Usage:

server = require('http-server-dev')   
server(option, callback)  

option

var config = {
    hostname : '0.0.0.0',
    port: '80',
    webPath: [__dirname],
    proxies:{
        '/speapi':{
            host: 'api.demo.com',
            headers:{
                host: 'api.demo.com'
            }
        }
    }
}

Package Sidebar

Install

npm i http-server-dev

Weekly Downloads

2

Version

1.0.11

License

ISC

Last publish

Collaborators

  • suxiaoxin