# gulp-forward

> gulp FED test middleware，script local，data remote！

Latest version **0.9.0** (published 2017-08-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install gulp-forward
pnpm add gulp-forward
yarn add gulp-forward
bun add gulp-forward
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2017-08-11 |
| First published | 2017-08-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | LanceLou |
| Maintainers | lancelou |
| Keywords | gulp, middleware, test |

## Links

- npm: https://www.npmjs.com/package/gulp-forward
- Repository: https://github.com/LanceLou/gulp-forward
- Homepage: https://github.com/LanceLou/gulp-forward#readme
- Issues: https://github.com/LanceLou/gulp-forward/issues
- npm.io page: https://npm.io/package/gulp-forward

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^2.0.1
- [moment](https://npm.io/package/moment.md) ^2.18.1
- [http-proxy](https://npm.io/package/http-proxy.md) ^1.16.2

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 0.9.0 (latest) — 2017-08-11
- 0.0.8 — 2017-08-04
- 0.0.7 — 2017-08-03
- 0.0.6 — 2017-08-01
- 0.0.5 — 2017-08-01

## README

# gulp-forward
gulp FED test middleware，script local，data remote！


## Installation

Using npm:

```bash
$ npm i --save-dev gulp-forward
```

Config in gulpfile.js

* First, you need use gulp with gulp-connect as you local dev server。
* Then, Config something, that's depend on your project！

Example(In our project, we config like this below):


**dev mock server**:

```JavaScript
{
  proxyOpt: 1,
  mockConfig: {
    mockDir: `${__dirname}/test/frontEnd/`,
    mockReg: /\/xhr(\/[\w.]+)+$/,
  },
}
```


**test remote forward**

***the rules regexp is design to intercept the rquest and forward to local server(the gulp server), otherwise, the request will be proxy to remote server***

```JavaScript
{
  proxyOpt: 2,
  remoteUrl: 'http://miq.lancelou.com',
  remotePort: 80,
  rules: [
    {
      reg: /(\/js\/\w*)-.*(\.js)$/,
      replace: '$1$2',
    },
    {
      reg: /(\/js\/.*\.js.map)$/,
      replace: '$1',
    },
  ],
}
```

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