dev-proxy-server
v1.0.23
Published
An simple proxy server
Downloads
1,656
Readme
介绍
本地开发时可用的proxy代理插件
如何使用
npm i dev-proxy-server
import proxyServer from 'dev-proxy-server';
proxyServer({
port: 8080,
});
相关参数
ServerOptions | prop | type | default | required | | :--------- | :------ | :-------- | :------- | | https | Boolean | false | false | | port | Number | 3000 | false | | proxyTable | Array | [] | false | | outputPath | string | undefined | false |
ProxyTable | prop | type | default | required | | :--------- | :------ | :-------- | :------- | | match | String | undefined | true | | target | String | undefined | true | | rewrite | Object | undefined | false | | local | Boolean | false | false |
interface Rewrite {
[key: string]: string;
}
// 示例
const proxyTable = {
match: '/api';
target: 'http://dev.myapp.com';
rewrite: {
'^/api': '/api_dev'
};
}
Gitee
https://gitee.com/mooselee/dev-proxy-server