@midwayjs/http-proxy
TypeScript icon, indicating that this package has built-in type declarations

3.16.2 • Public • Published

HTTP 代理组件

HTTP 代理组件

适用于 @midwayjs/faas@midwayjs/web@midwayjs/koa@midwayjs/express 多种框架的 HTTP 代理组件,支持GET、POST等多种请求方法。

Usage

  1. 安装依赖
$ npm i @midwayjs/http-proxy --save
  1. 在 configuration 中引入组件,
import * as proxy from '@midwayjs/http-proxy';
@Configuration({
  imports: [
    // ...other components
    proxy
  ],
})
export class AutoConfiguration {}

配置

export const httpProxy = {
  host: 'http://127.0.0.1',
  match: /\/assets\/(.*)/,
  target: 'http://127.0.0.1/$1',
}

Readme

Keywords

Package Sidebar

Install

npm i @midwayjs/http-proxy

Weekly Downloads

70

Version

3.16.2

License

MIT

Unpacked Size

14.4 kB

Total Files

14

Last publish

Collaborators

  • mariodu
  • czy88840616
  • legendecas
  • echosoar
  • lellansin
  • lxxyx
  • stone-jin