angular-material-course icon indicating copy to clipboard operation
angular-material-course copied to clipboard

2-data-table-finished port mismatch

Open kjenney opened this issue 6 years ago • 1 comments

The HTTP Request from the Frontend is being directed to the same server/port:

"Http failure response for http://localhost:4200/api/courses: 404 Not Found"

while the backend server is running on port 9000. Shouldn't the request be going to http://localhost:9000/api/couses?

kjenney avatar Feb 28 '18 14:02 kjenney

@kjenney This app uses a proxy to redirect all calls. Did you use ng serve instead of npm run start? If that's the case there is your problem. If you want to serve the application on a other port you can do so by using the following command; ng serve --port=XXXX --proxy-config ./proxy were XXXX is the desired port number. The proxy config is in proxy.json in the root of the project.
For more information about using a proxy take a look at this article https://juristr.com/blog/2016/11/configure-proxy-api-angular-cli/ or the official docs https://github.com/angular/angular-cli/blob/master/docs/documentation/stories/proxy.md

bramleffers avatar Apr 04 '18 12:04 bramleffers