Skip to content

Commit 35e841f

Browse files
committed
Deploy to Netlify
1 parent dfa8034 commit 35e841f

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

projects/bookings/netlify.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build]
2+
publish = "dist"
3+
command = "npm ci && npm run lint bookings && npm run test bookings && npm run build bookings -- --configuration production"

projects/train-platform/netlify.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[build]
2+
publish = "dist"
3+
command = "npm ci && npm run lint train-platform && npm run test train-platform && npm run build train-platform -- --configuration production"
4+
5+
[[redirects]]
6+
from = "/frontends/bookings/*"
7+
to = "https://cozy-concha-0ad972.netlify.app/:splat"
8+
force = true
9+
status = 200
10+
11+
[[redirects]]
12+
from = "/*"
13+
to = "/index.html"
14+
status = 200

projects/train-platform/src/micro-frontends/bookings-host.module.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
22
import { RouterModule } from '@angular/router';
3+
import { environment } from '../environments/environment';
34
import { BookingsHostComponent } from './bookings-host.component';
45
import { LoadMicroFrontendGuard } from './load-micro-frontend.guard';
56
import { MicroFrontendLanguageDirective } from './micro-frontend-language.directive';
67
import { MicroFrontendRoutingDirective } from './micro-frontend-routing.directive';
78

9+
const getMicrofrontendBundleUrl = (frontendName: 'bookings') =>
10+
`/frontends/${frontendName}/main.js`;
11+
812
@NgModule({
913
declarations: [
1014
BookingsHostComponent,
@@ -18,7 +22,9 @@ import { MicroFrontendRoutingDirective } from './micro-frontend-routing.directiv
1822
canActivate: [LoadMicroFrontendGuard],
1923
component: BookingsHostComponent,
2024
data: {
21-
bundleUrl: 'http://localhost:4201/main.js',
25+
bundleUrl: environment.production
26+
? getMicrofrontendBundleUrl('bookings')
27+
: 'http://localhost:4201/main.js',
2228
},
2329
},
2430
]),

0 commit comments

Comments
 (0)