# coffee-proxy-server

> dev-sever

Latest version **0.0.3** (published 2018-12-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install coffee-proxy-server
pnpm add coffee-proxy-server
yarn add coffee-proxy-server
bun add coffee-proxy-server
```

Provides the command `coffeeProxy`.

## 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.0.3 |
| Published | 2018-12-02 |
| First published | 2018-12-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | walle |
| Maintainers | coolcoffee |

## Links

- npm: https://www.npmjs.com/package/coffee-proxy-server
- Repository: https://github.com/wangchaoyi/coffee-proxy-server
- Homepage: https://github.com/wangchaoyi/coffee-proxy-server#readme
- Issues: https://github.com/wangchaoyi/coffee-proxy-server/issues
- npm.io page: https://npm.io/package/coffee-proxy-server

## Dependencies (2)

- [express](https://npm.io/package/express.md) ^4.16.4
- [http-proxy-middleware](https://npm.io/package/http-proxy-middleware.md) ^0.19.1

## Recent versions

- 0.0.3 (latest) — 2018-12-02
- 0.0.2 — 2018-12-02
- 0.0.1 — 2018-12-02

## README

# coffee-proxy-server README.md
一个快速创建反向代理的小工具。

### 为什么需要它？ 
因为可能存在后端接口没有做CROS，导致前端这边只能采用反向代理来解决跨域问题。 

### 为什么不用vue-cli或者creact-react-app里面内置的反向代理？
因为有些旧版本的vue-cli无法生效。 或者有些非vue或者react的项目也想要在开发过程中使用反向代理。

### 如何使用？
##### 使用npm
`npm install -g coffee-proxy-server`
##### 使用yarn
`yarn global add coffee-proxy-server`

安装完成之后， 系统命令会多一个`coffeeProxy`

### 项目配置
目前暂只支持在项目下加入**coffee-proxy-config.js**，后续会考虑自定义路径

**coffee-proxy-config.js** 示例：
```  javascript
module.exports = {
  "port": 9000,
  "options": {
    "/v2/api": {
      "target": "http://api-server-example.xxx",
      "changeOrigin": true
    },// 匹配api路径以及转发域名
    "/": {
      "target": "http://localhost:8080",
      "changeOrigin": false
    } // 本地前端开发服务器
  }
};
```

然后在项目中执行coffeeProxy， 如果存在该文件， 则会成功创建一个反向代理服务器。

### 项目源代码
[https://github.com/wangchaoyi/coffee-proxy-server.git](**)


#Studying/小工具

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