I use express where I made fun of the API calls for my application.
Is there any proxy server that I can use to redirect my calls to my dev server?
Below is an example of express code
var express = require('express'); var app = express(); var path = require('path'); var cors = require('cors'); app.use(express.static(path.join(__dirname, 'public'))); app.use(express.static(path.join(__dirname, 'dist'))); app.get('/brand', function(req,res){ res.send({"brand":"Cadillac","origin":"USA"}); });
When I launch my application in the local API from my code, " http: // localhost: 3000 / brand " should be redirected to " http://www-dev.abc.com/brand "
Before redirecting, I also need to set a cookie, since the API only gives data when there is a valid cookie.
Is there a proxy server that I can use? Could you give some examples?
source share