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?
GET http://localhost:4200/ net::ERR_CONNECTION_REFUSED any help?
20 Replies
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?Yes i set it in program.cs
But when the backend starts, what does it print in the console?
And how are you starting it?
I start it directly from vs
Ok so look at the console window that appears when you start it
Show me the full output
Working on it
So not 4200
So in launch.json
I have to set it to 4200?
Https on 7295, and http on 5279
That's cors, that's unrelated to the actual binding
So the front end local host should be 7259 too?
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?
Typescript angular react
Basically
Angular and react? Weird.
But anyways, vite?
What’s vite
A very common js/ta build/dev tool
Would you have time in about an hour to introduce it to me
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
okay i fixed it
apparently i was using vite all along
i was missing s in https