I have a problem between Angular and .Net-Core after I publish to IIS.
The app runs fine on my local machine but when I publish to IIS the Angular app can't talk to the .Net app.
I can see the home page, but can't do a search on the page (which communicates with the API and DB)
Where do I start to debug this? What can I do to debug where the error is coming from?
Should I start looking at the configuration between the two apps or something on the server (IIS)?
I have an error.interceptor.ts file that does this:
export class ErrorInterceptor implements HttpInterceptor {
intercept(request: HttpRequest < any > , next: HttpHandler): Observable < HttpEvent < any >> {
return next.handle(request)
.pipe(
catchError((error: HttpErrorResponse) => {
let errorMessage = '';
if (error.error instanceof ErrorEvent) {
// client-side error
errorMessage = `Error: ${error.error.message}`;
} else {
// server-side error
errorMessage = `Error Code: ${error.status}\nMessage: ${error.message}\nStatusText: ${error.statusText}`;
}
window.alert(errorMessage);
return throwError(errorMessage);
})
);
}
}
and in the window alert I see this