Skip to content

Commit 10471df

Browse files
committed
Improve test backend configuration
Use an environment property for backend url Use proxy in npm start use Plone for default plone id
1 parent 0ae94b3 commit 10471df

File tree

5 files changed

+7
-4
lines changed

5 files changed

+7
-4
lines changed

tests/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "MIT",
55
"scripts": {
66
"ng": "ng",
7-
"start": "ng serve",
7+
"start": "ng serve --proxy-config proxy.conf.json",
88
"build": "ng build",
99
"test": "ng test",
1010
"lint": "ng lint",

tests/proxy.conf.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"/test2": {
2+
"/Plone": {
33
"target": "http://127.0.0.1:8080",
44
"secure": true
55
}
6-
}
6+
}

tests/src/app/app.module.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { AppComponent } from './app.component';
99
import { CustomViewView } from './custom';
1010
import { CustomBreadcrumbs } from './custom';
1111
import { CustomGlobalNavigation } from './custom';
12+
import { environment } from '../environments/environment';
1213

1314
@NgModule({
1415
declarations: [
@@ -29,7 +30,7 @@ import { CustomGlobalNavigation } from './custom';
2930
providers: [
3031
{
3132
provide: 'CONFIGURATION', useValue: {
32-
BACKEND_URL: 'http://localhost:8080/test2',
33+
BACKEND_URL: environment.backendUrl,
3334
}
3435
},
3536
],
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const environment = {
2+
backendUrl: 'http://localhost:4200/Plone',
23
production: true
34
};

tests/src/environments/environment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
// The list of which env maps to which file can be found in `.angular-cli.json`.
55

66
export const environment = {
7+
backendUrl: 'http://localhost:4200/Plone',
78
production: false
89
};

0 commit comments

Comments
 (0)