My "assets" folder is properly packaged in the build, but once deployed on the App Service, the browser gets 404 errors.
Here's the angular.json part that makes the build include everything in the folder
"assets": [
"src/assets"
]
Here's what's actually in the folder over at the app service:
And the errors in Chrome
The errors are triggered by this service, which attempts to load the json files.
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpClientModule, HttpClient } from '@angular/common/http';
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http,
'/assets/translations/',
'.json');
}
@NgModule({
declarations: [],
imports: [
CommonModule,
HttpClientModule,
TranslateModule.forRoot({
defaultLanguage: 'en',
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient],
},
}),
],
exports: [TranslateModule],
})
export class NgxTranslateModule { }
This works fine locally.
All the solutions I've seen refer to web.config
to make it work, but this is .NET Core, so that file isn't honored.
Any ideas ?