I am trying to setup poc for docker with one simple project. It includes angular, express, nodejs and mongodb atlas.
angular runs on 4200 and nodejs 3000
https://github.com/changan1111/UserManagement
it is working fine in local the same setup..
When I go for docker?
I am seeing that node js is started and running.
When I see the list of files, I am seeing all good.
When I go for http://localhsot/user it returns values
But when I read the value from browser it is showing
i have tried few solutions which is given but all returns same response that failed. what is wrong with this.. can any one look in to this and let me know that what is the problem on the setup.
app.use(cors());
/*
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "req.headers.origin"); // update to match the domain you will make the request from
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
res.header("Access-Control-Allow-Methods", "DELETE,PUT,GET,POST");
next();
});*/
/*
app.use(cors({
"origin": ['http://localhost:3000'],
"methods": "GET,PUT,POST",
"preflightContinue": false,
"credentials": true
}));*/
tried with ip address http://192.168.0.103/ as well but no change Dockerfile:







localhost:3000/userand notlocalhost/user. And your problem is, that your app somehow is reachable on80instead of3000?