# Configuring mailing-service with mfe Commit with changes: https://gitlab.com/1000kit/apps/mailing-service/mailing-service-ui/-/commit/4555a435ef6d712231abc4f314fcd486546e5d60 * added `ngx-build-plus` dependency and changed angular.json (look at the example) * added `microfrontend.json` and `templates/mf-config.yaml` files in the helm directory * added `wepack.config.js` file and `webpack.prod.conf.json` * added `providedIn: 'any'` to apigen.yaml and made sure that all generated services have ``` @Injectable({ providedIn: "any", }) ``` * exposed tkit portal server directly, not through BFF (not sure if it's needed) * in main routing module we always have to use import like this when loading components: ``` loadChildren: () => import("./modules/search-template/search-template.module").then( (m) => m.SearchTemplateModule ), ``` * TranslateService changes in app.module.ts (see example) * added remote module * added `canActivate: [CanActivateGuard]` to all routes beside routes in the main routing module * added `PortalCoreModule.forMicroFrontend()` to imports in all modules beside the main one * added can-active-guard service * changed shared module (see example) * added utils file with function ``` export const basePathProvider = (mfeInfo: MfeInfo) => { console.log(`Base path provider ${mfeInfo?.remoteBaseUrl}`); return mfeInfo ? mfeInfo.remoteBaseUrl + "mail-api" : "./mail-api"; }; ``` * added bootstrap.ts file and changed the main.ts file (see example) * added remote module to `files` in tsconfig.app.json * made sure that `mailing-service-ui` keycloak client exists (it didn't) * added OPS portal and created a new microservice And it worked :)