A better http-proxy-middleware with hot update config and cli
npm install hotproxy
# or use yarn
yarn add hotproxy
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)
npm i hotproxy -g
echo "module.exports = {
'/': {
target: 'https://www.baidu.com',
changeOrigin: true,
logLevel: 'debug'
}
}
" > hotproxy.config.js
hotproxy
hotproxy --help
- 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 :)
This library is written and maintained by imcuttle, moyuyc95@gmail.com.
MIT - imcuttle 🐟