I\'m trying to do something like this:
// Setup prox to handle blog requests
httpProxy.createServer({
hostnameOnly: true,
router: {
\'http://
I have used simple solution to proxified my GET/POST requests.
var httpProxy = require('http-proxy');
var apiProxy = httpProxy.createProxyServer();
app.post("/api/*", function(req, res) {
apiProxy.web(req, res, { target: 'http://localhost:5000'})
});
app.get("/api/*", function(req, res) {
apiProxy.web(req, res, { target: 'http://localhost:5000'})
});
another easier way to handle all type of requests is:
app.all("/api/*", function(req, res) {
apiProxy.web(req, res, { target: 'http://localhost:5000'})
});
NOTE: above functions must be before bodyparser.