|
1 | | -import { Injectable, Inject } from '@angular/core'; |
| 1 | +import { Injectable } from '@angular/core'; |
2 | 2 | import { Http, Response } from '@angular/http'; |
3 | 3 |
|
4 | 4 | import { Observable } from 'rxjs/Observable'; |
5 | 5 | import 'rxjs/add/operator/catch'; |
6 | 6 | import 'rxjs/add/operator/map'; |
7 | 7 |
|
8 | | -import { WIT_API_URL } from 'ngx-fabric8-wit'; |
9 | | - |
10 | 8 | @Injectable() |
11 | 9 | export class StackAnalysesService { |
12 | 10 |
|
13 | 11 | private stackAnalysesUrl: string = ''; |
14 | 12 |
|
15 | | - private recommenderString: string = 'recommender'; |
16 | | - private doubleSlash: string = '//'; |
17 | | - private dot: string = '.'; |
18 | | - private singleSlash: string = '/'; |
19 | | - private v1Extension: string = 'v1'; |
20 | | - |
21 | 13 | constructor( |
22 | 14 | private http: Http, |
23 | | - @Inject(WIT_API_URL) apiUrl: string, |
24 | 15 | ) { |
25 | | - if(process && process.env && process.env.FABRIC8_RECOMMENDER_API) { |
26 | | - this.stackAnalysesUrl = process.env.FABRIC8_RECOMMENDER_API; |
27 | | - } else { |
28 | | - if(apiUrl) { |
29 | | - this.stackAnalysesUrl = apiUrl.replace(this.doubleSlash, this.doubleSlash + this.recommenderString + this.dot); |
30 | | - let len: number = this.stackAnalysesUrl.length; |
31 | | - if(this.stackAnalysesUrl[len - 1] !== this.singleSlash) { |
32 | | - this.stackAnalysesUrl += this.singleSlash; |
33 | | - } |
34 | | - this.stackAnalysesUrl += this.v1Extension + this.singleSlash; |
35 | | - } |
| 16 | + this.stackAnalysesUrl = 'https://recommender.api.prod-preview.openshift.io/api/v1/'; |
36 | 17 | } |
37 | | - } |
38 | 18 |
|
39 | 19 | getStackAnalyses(id: string): Observable<any> { |
40 | 20 | return this.http.get(this.buildStackAnalysesUrl(id)) |
|
0 commit comments