Created
April 23, 2020 07:39
-
-
Save sunb0002/8cedc834d440f1e52afedeaa639fec35 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const express = require('express'); | |
const { createProxyMiddleware } = require('http-proxy-middleware'); | |
const app = express(); | |
app.use('/aaa/bbb/ccc/', createProxyMiddleware({ | |
target: 'http://10.1.2.3:1234', | |
changeOrigin: true, | |
pathRewrite: { | |
'^/aaa/bbb/ccc/': '/' | |
}, | |
})); | |
app.listen(8451, () => { | |
console.log("Node.js proxy is running...") | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment