0

I have an express app which listening on port 5000 like this:

app.listen(5000, "0.0.0.0, ()=>'Server started on' + 'port ' + 5000).

When I try to send a post request by node script using axios or curl its response me 200.

axios.post('http://localhost:5000/api/auth/login', {})

or

curl -d "username=daniel&password=daniel&role=owner" -X POST http://localhost:5000/api/auth/login

But I when I try sending the same request using Angular HttpClient.Post its gives me an error :

POST http://localhost:5000/api/auth/login net::ERR_CONNECTION_REFUSED

The problem started when I tried to run all of these components on a remote server.

it works for me fine when I tried to run all of these components on my local machine.

Any ideas why it should happen?

I would appreciate your help!

0 Answers0