# fis3-deploy-http-push

> fis3 deploy http-push plugin

Latest version **2.0.8** (published 2023-01-12) · BSD license · 0 weekly downloads

## Install

```sh
npm install fis3-deploy-http-push
pnpm add fis3-deploy-http-push
yarn add fis3-deploy-http-push
bun add fis3-deploy-http-push
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.8 |
| Published | 2023-01-12 |
| First published | 2015-05-22 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 11.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Author | FIS |
| Maintainers | 2betop, fansekey, fis-dev |
| Keywords | fis, fis-plus, fis3, deploy |

## Links

- npm: https://www.npmjs.com/package/fis3-deploy-http-push
- Repository: https://github.com/fex-team/fis3-deploy-http-push
- Homepage: https://github.com/fex-team/fis3-deploy-http-push#readme
- Issues: https://github.com/fex-team/fis3-deploy-http-push/issues
- npm.io page: https://npm.io/package/fis3-deploy-http-push

## Dependencies (2)

- [colors](https://npm.io/package/colors.md) 1.4.0
- [prompt](https://npm.io/package/prompt.md) 1.0.0

## Recent versions

- 2.0.8 (latest) — 2023-01-12
- 2.0.7 — 2022-01-10
- 2.0.6 — 2017-01-19
- 2.0.5 — 2016-12-20
- 2.0.4 — 2016-12-17
- 2.0.3 — 2016-12-15
- 2.0.2 — 2016-12-15
- 2.0.1 — 2016-12-15
- 2.0.0 — 2016-12-15
- 1.1.1 — 2016-08-03
- 1.1.0 — 2016-07-13
- 1.0.3 — 2016-06-08
- 1.0.2 — 2016-06-08
- 1.0.1 — 2015-05-29
- 1.0.0 — 2015-05-22

## README

# fis3 http 部署插件

FIS 默认的部署插件，提供本地部署以及远程upload部署能力。

## 关于文件接收器 receiver.php

**此代码存在很大的安全隐患，没有做任何安全考虑，请不要部署到线上服务。**

百度内部请使用：http://agroup.baidu.com/fis/md/article/196978

## 安装

全局安装或者本地安装都可以。

```
npm install fis3-deploy-http-push --save-dev
```

## 使用方法

也可以使用统一的 deploy 插件配置方法

```javascript
fis.match('*.js', {
    deploy: fis.plugin('http-push', {
        //如果配置了receiver，fis会把文件逐个post到接收端上
        receiver: 'http://www.example.com:8080/receiver.php',
        //这个参数会跟随post请求一起发送
        to: '/home/fis/www',
        // 附加参数, 后端通过 $_POST['xx'] 获取
        // 如果 data 中 含有 to 这个 key, 那么上面那个to参数会覆盖掉data里面的to
        data: {
            token : 'abcdefghijk',
            user : 'maxming',
            uid : 1
        }
    })
})
```

## 另类使用方法

比如: 部署时需要 token 输入

举一反三

```javascript
const crypto = require('crypto');
const readlineSync = require('readline-sync');
fis.match('**', {
  deploy: [
    function (options, modified, total, next) {
      var token = readlineSync.question('\r\n请输入授权token : ', {
        hideEchoBack: true
      });
      if (!token) {
        return false;
      }
      var md5 = crypto.createHash('md5');
      fis.set('project.token', md5.update(token).digest('hex'));
      next();
    },
    function () {
      arguments[0] = {
        //如果配置了receiver，fis会把文件逐个post到接收端上
        receiver: 'http://127.0.0.1/receiver.php?debug=false',
        // receiver: 'http://127.0.0.1/receiver.php',
        //这个参数会跟随post请求一起发送
        to: '/home/fis/www',
        // to: '/Users/fis/www',
        // 附加参数, 后端通过 $_POST['xx'] 获取
        data: {
          token: fis.get('project.token')
        }
      };
      require('fis3-deploy-http-push').apply(this, arguments);
    }
  ]
});
```

---
_Source: https://npm.io/package/fis3-deploy-http-push · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
