Skip to content

Commit c084892

Browse files
committed
up prerender
1 parent e84c841 commit c084892

File tree

8 files changed

+20
-7
lines changed

8 files changed

+20
-7
lines changed

prerender.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { environment } from './src/environments/environment';
12

23
const domino = require('domino');
34
const fs = require('fs');
@@ -76,7 +77,7 @@ ROUTES.forEach(route => {
7677
},
7778
{
7879
provide: 'ORIGIN_URL',
79-
useValue: 'http://localhost:4000'
80+
useValue: environment.host
8081
}
8182
]
8283
})).then(html => writeFileSync(join(fullPath, 'index.html'), html));

src/app/transfer-back/transfer-back.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@
66
<br/>
77
{{resultPost | json}}
88
<br/>
9+
ORIGIN_URL = {{baseUrl}}
10+
<br/>

src/app/transfer-back/transfer-back.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class TransferBackComponent implements OnInit {
1313
constructor(
1414
private http: TransferHttp,
1515
@Inject(AppStorage) private appStorage: Storage,
16-
@Inject('ORIGIN_URL') private baseUrl: string
16+
@Inject('ORIGIN_URL') public baseUrl: string
1717
) {
1818
console.log(`ORIGIN_URL=${baseUrl}`);
1919
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export const environment = {
22
production: true,
3-
isServer: false
3+
isServer: false,
4+
// for prerender
5+
host: 'http://localhost:4000'
46
};

src/environments/browser/environment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55

66
export const environment = {
77
production: false,
8-
isServer: false
8+
isServer: false,
9+
// for prerender
10+
host: 'http://localhost:4000'
911
};

src/environments/environment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55

66
export const environment = {
77
production: false,
8-
isServer: false
8+
isServer: false,
9+
// for prerender
10+
host: 'http://localhost:4000'
911
};
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
export const environment = {
22
production: true,
3-
isServer: true
3+
isServer: true,
4+
// for prerender
5+
host: 'http://localhost:4000'
46
};

src/environments/server/environment.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@
55

66
export const environment = {
77
production: false,
8-
isServer: true
8+
isServer: true,
9+
// for prerender
10+
host: 'http://localhost:4000'
911
};

0 commit comments

Comments
 (0)