Advertisement
Shell_Casing

angular

Dec 7th, 2018
442
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Injectable } from '@angular/core';
  2. import { HttpClient, HttpHeaders } from '@angular/common/http';
  3.  
  4. @Injectable({
  5.   providedIn: 'root'
  6. })
  7. export class HistorianAPIService {
  8.  
  9.   access_token = 'eyJhbGciOiJSUzI1NiJ9.eyJqs8V38Q';
  10.  
  11.   headers = new HttpHeaders({
  12.     'Authorization': `Bearer ${this.access_token}`,
  13.     'mode': 'cors'
  14.   });
  15.  
  16.   private server_url = `http://10.1.1.31:80/historian-rest-api/v1/tags?nameMask=*&maxNumber=100`;
  17.  
  18.   constructor(private http: HttpClient) { }
  19.  
  20.   checkHistorianAPI() {
  21.     return this.http.get(this.server_url, { headers: this.headers });
  22.   }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement