# tapc-plugin-assets

[![test][test-image]][ci-url]
[![lines coverage][lines-coverage-image]][ci-url]
[![branches coverage][branches-coverage-image]][ci-url]
[![functions coverage][functions-coverage-image]][ci-url]
[![statements coverage][statements-coverage-image]][ci-url]

[ci-url]: http://ci.uitest.taobao.net/task?repo=tap/tapc-plugin-assets
[test-image]: http://ci.uitest.taobao.net/badge?repo=tap/tapc-plugin-assets&plugin=test
[lines-coverage-image]: http://ci.uitest.taobao.net/badge?repo=tap/tapc-plugin-assets&plugin=test&coverage=lines
[branches-coverage-image]: http://ci.uitest.taobao.net/badge?repo=tap/tapc-plugin-assets&plugin=test&coverage=branches
[functions-coverage-image]: http://ci.uitest.taobao.net/badge?repo=tap/tapc-plugin-assets&plugin=test&coverage=functions
[statements-coverage-image]: http://ci.uitest.taobao.net/badge?repo=tap/tapc-plugin-assets&plugin=test&coverage=statements

tapc assets插件，资源代理

## Install

```bash
$ npm install -g tapc
```

## Usage

### `-p`或`--port`

指定HTTP服务器端口

```bash
# 指定HTTP端口为8888
$ tapc assets -p 8888
$ tapc assets --port 8888  
```

### `-s`或`--sslPort`

指定HTTPS服务器端口

```bash
# 指定HTTPS端口为8888
$ tapc assets -s 8888
$ tapc assets --sslPort 8888  
```

### `-r`或`--root`

指定代理服务器根目录，默认值为`~/.tap/LocalCDNPath/`

```bash
# 指定代理根目录为~/.tap

$ tapc assets -r ~/.tap
$ tapc assets --root ~/.tap
```

### `-u`或`--useSrc`

指定优先从src目录代理

```bash
# 指定资源优先从src代理

$ tapc assets -u
$ tapc assets --useSrc
```

## Test

```bash
$ npm run build # build the source code with babel
$ npm run dev # build automatically when files change
$ npm run test # run unit tests
```

## License

The MIT License (MIT)

Copyright (c) 2015 tmallfe

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
