0.1.6 • Published 7 years ago

kitty-serve v0.1.6

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

kitty-serve

安装

npm install kitty-serve --save

使用

var kitty = require('vkitty');
var serve = require('kitty-serve');
kitty.watch('./pages/*/index.html')
    .pipe(serve.src({port:8080}))
    .pipe(serve.cdn({port:8081}))
gulp.task('mock', function () {
    kitty.watch(['./mock/h5/*/*.json'])
        .pipe(serve.src(
            {
                port: 7001,
                prePath: "/h5",
                headers: {
                    "Content-Type":"application/json;charset=UTF-8",
                    "Access-Control-Allow-Origin": "http://h5.dev.weidian.com",
                    "Access-Control-Allow-Credentials": "true"
                }
            }
        ))
});

方法

每个方法只能被调用一次,可以好好利用serve.all及serve.src

options

port - 端口,默认80

prePath - 前缀地址,默认undefined,如果设置了该项,那么访问的时候需要加上前缀地址。

headers - 输出headers设置 如{"power":"vkitty.org"}

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago