I have an angular 2 app with a simple server.js as a node.js BE.
I have deployed my application to Azure and I'm at the point that the application loads and shows me the welcoming page.
When I reach a component that tries to read a local JSON via an HTTP request I'm getting a 404 error (that I don't receive in my local environment).
The code to read the json is the following:
private ReadFromJson(path: string): Observable<string[]> {
return this._http.get(path)
.map((response: Response) => <string[]>response.json())
.do(data => console.log('All: ' + JSON.stringify(data)))
.catch(this.handleError);
}
where the actual path passed is the one showed in the console.
I have done two things: First I made sure that the file is actually there using the Azure CLI, and it is there as expected.
Secondly, after viewing many posts the only other solution I found was to add the MIME type as suggested here, but that didn't work for me as well.
I would really like some help in understanding and be troubleshooting the problem, any suggestion is welcomed!