hotproxy
v1.0.4
Published
A better http-proxy-middleware with hot update config and cli
Downloads
13
Readme
hotproxy
A better http-proxy-middleware with hot update config and cli
Installation
npm install hotproxy
# or use yarn
yarn add hotproxy
Usage
Package
const app = require('express')()
const { hotProxy } = require('hotproxy')
const middleware = hotProxy(
'/path/to/configFile', // Assign configuration file, It will find up the closest file named `hotproxy.config.js` when not setting.
{
// common config
logLevel: 'debug'
}
)
app.use(middleware)
// Or
app.use('/context', middleware)
Cli
npm i hotproxy -g
echo "module.exports = {
'/': {
target: 'https://www.baidu.com',
changeOrigin: true,
logLevel: 'debug'
}
}
" > hotproxy.config.js
hotproxy
hotproxy --help
Config
Contributing
- Fork it!
- Create your new branch:
git checkout -b feature-new
orgit checkout -b fix-which-bug
- Start your magic work now
- Make sure npm test passes
- Commit your changes:
git commit -am 'feat: some description (close #123)'
orgit commit -am 'fix: some description (fix #123)'
- Push to the branch:
git push
- Submit a pull request :)
Authors
This library is written and maintained by imcuttle, [email protected].
License
MIT - imcuttle 🐟