30 lines
681 B
TypeScript
30 lines
681 B
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import { HttpClient, HttpHeaders } from '@angular/common/http';
|
||
|
|
import { Links } from './links';
|
||
|
|
import { Observable } from 'rxjs';
|
||
|
|
import * as _ from 'lodash';
|
||
|
|
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class LinksService {
|
||
|
|
|
||
|
|
constructor(private http: HttpClient) { }
|
||
|
|
private apiUrl = 'http://10.0.0.104:8055/items/landingpage';
|
||
|
|
public apiKey = 'KGjpxZ3tesmhEXHS7C7JbKDyW6YJlgQT';
|
||
|
|
|
||
|
|
httpOptions = {
|
||
|
|
headers: new HttpHeaders({
|
||
|
|
'Authorization': `Bearer ${this.apiKey}`,
|
||
|
|
}),
|
||
|
|
};
|
||
|
|
|
||
|
|
getLinks(): Observable<Links> {
|
||
|
|
return this.http
|
||
|
|
.get<Links>(this.apiUrl, this.httpOptions)
|
||
|
|
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|