0

I have setup my backend Web API created in VS2015 in the IIS server and I can access it via URL

http://192.168.137.15:53610/

I have ng-build --prod my frontend angular2 application and served it using http-serve inside the dist folder which I access via URL

http://192.168.137.15:8080/index.html

If I access the frontend in my pc, I can access the webapi so I can login. But if I access my frontend from a LAN, I can access the frontend because I can get to the login screen. But as soon as I click the submit button, I get the error of

OPTIONS http://localhost: polyfill.4afb43cdae.....bundle.js:153610/token net::ERR_CONNECTION_REFUSED

. Can you please show me how to do this right. Thank you.

3
  • 1
    According to the error message, it seems you have send option request to localhost instead of the 192.168.137.15:53610. I suggest you could check you angular codes to make sure you send the request to right url. Commented Jul 5, 2019 at 7:04
  • Thanknyou. You're right. It was pointing to the wrong IP. Commented Jul 5, 2019 at 8:46
  • If you feel my comment is right, I will write a reply. Please mark it as answer and it will help other people who faces the same issue. Commented Jul 9, 2019 at 2:25

1 Answer 1

2

According to the error message, it seems you have send option request to localhost instead of the 192.168.137.15:53610. I suggest you could check you angular codes to make sure you send the request to right url.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.