C
C#2mo ago
Maru

API

hello som im trying to connect my be with fe i have set the correct local hosts but when i send a request to be it says this inspector.js:7

GET http://localhost:4200/ net::ERR_CONNECTION_REFUSED any help?
20 Replies
Pobiega
Pobiega2mo ago
are you sure the backend is listening on http://localhost:4200/? its not https? its not listening specifically on another ip or host? its the correct port?
Maru
MaruOP2mo ago
Yes i set it in program.cs
Pobiega
Pobiega2mo ago
But when the backend starts, what does it print in the console? And how are you starting it?
Maru
MaruOP2mo ago
I start it directly from vs
Pobiega
Pobiega2mo ago
Ok so look at the console window that appears when you start it Show me the full output
Maru
MaruOP2mo ago
Working on it
Maru
MaruOP2mo ago
No description
Pobiega
Pobiega2mo ago
So not 4200
Maru
MaruOP2mo ago
No description
Maru
MaruOP2mo ago
So in launch.json I have to set it to 4200?
Pobiega
Pobiega2mo ago
Https on 7295, and http on 5279 That's cors, that's unrelated to the actual binding
Maru
MaruOP2mo ago
So the front end local host should be 7259 too?
Pobiega
Pobiega2mo ago
Your FE and BE are probably different programs during development Either set a dev proxy from FE to BE, or use the real BE addr directly But its not listening on 4200, as you can see from the output What kind FE is it? Is it using vite?
Maru
MaruOP2mo ago
Typescript angular react Basically
Pobiega
Pobiega2mo ago
Angular and react? Weird. But anyways, vite?
Maru
MaruOP2mo ago
What’s vite
Pobiega
Pobiega2mo ago
A very common js/ta build/dev tool
Maru
MaruOP2mo ago
Would you have time in about an hour to introduce it to me
Pobiega
Pobiega2mo ago
Well if you are not already using it, that might be painful to introduce now you normally use it to start a FE project https://vite.dev/guide/ anyways, teh reason I mention it is that it has built in proxy server which makes it easy to have separate FE/BE during dev but self-hosted FE via BE in release
Maru
MaruOP2mo ago
okay i fixed it apparently i was using vite all along i was missing s in https

Did you find this page helpful?