Skip to content

Commit 12c4c33

Browse files
committed
proxy js added
1 parent 825f5e1 commit 12c4c33

File tree

7 files changed

+33
-7
lines changed

7 files changed

+33
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",
7-
"develop": "ng serve --proxy-config proxy.json",
7+
"develop": "ng serve --port 5600 --proxy-config proxy.conf.js",
88
"build": "ng build",
99
"watch": "ng build --watch --configuration development",
1010
"build:gh": "ng build --base-href /angular-http-project/",

proxy.conf.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// var defaultTarget = 'http://localhost:3000';
2+
var defaultTarget = 'https://3000-actionanand-angularhttp-six5y8k89a8.ws-us116.gitpod.io';
3+
4+
module.exports = [
5+
{
6+
context: ['/api/v2/*'],
7+
target: defaultTarget,
8+
secure: false,
9+
logLevel: 'debug',
10+
changeOrigin: true,
11+
pathRewrite: {
12+
'^/api/v2/': '/',
13+
},
14+
},
15+
{
16+
context: ['/api/v2/**'],
17+
target: defaultTarget,
18+
secure: false,
19+
logLevel: 'debug',
20+
changeOrigin: true,
21+
pathRewrite: {
22+
'^/api/v2/': '/',
23+
},
24+
},
25+
];

proxy.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"/api/v2/*": {
3-
"target": "https://3000-actionanand-angularhttp-six5y8k89a8.ws-us116.gitpod.io",
3+
"target": "http://localhost:3000",
44
"secure": false,
55
"logLevel": "debug",
66
"changeOrigin": true,
77
"pathRewrite": {
88
"^/api/v2/": "/"
99
}
1010
},
11-
"/api/v1/*": {
11+
"/api/v2/**": {
1212
"target": "http://localhost:3000",
1313
"secure": false,
1414
"logLevel": "debug",
1515
"changeOrigin": true,
1616
"pathRewrite": {
17-
"^/api/v1/": "/"
17+
"^/api/v2/": "/"
1818
}
1919
}
2020
}

src/app/places/user-places/user-places.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
@if (places()) {
11-
<app-places [places]="places()!" (selectPlace)="onSelectPlaceRemoce($event)" />
11+
<app-places [places]="places()!" (selectPlace)="onSelectPlaceRemove($event)" />
1212
} @else if (places().length === 0) {
1313
<p class="fallback-text">Unfortunately, no places could be found.</p>
1414
}

src/app/places/user-places/user-places.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export class UserPlacesComponent implements OnInit {
3737
this.destroyRef.onDestroy(() => availablePlaceSub.unsubscribe());
3838
}
3939

40-
onSelectPlaceRemoce(place: Place) {
40+
onSelectPlaceRemove(place: Place) {
4141
const removePlSub = this.placeServ.removeUserPlace(place).subscribe({
4242
next: resp => console.log('Place renoved! ', resp),
4343
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
export const environment = {
22
backendUrl: 'https://3000-actionanand-angularhttp-six5y8k89a8.ws-us116.gitpod.io/',
3+
// backendUrl: 'http://localhost:3000/',
34
};

src/environments/environment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export const environment = {
2-
backendUrl: 'https://3000-actionanand-angularhttp-six5y8k89a8.ws-us116.gitpod.io/',
2+
backendUrl: 'http://localhost:3000/',
33
};

0 commit comments

Comments
 (0)