import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';

@Injectable({
    providedIn: 'root'
})
export class DataService {

    constructor(
        private http: HttpClient
    ) { }


    getPosts() {
        const httpOptions = {
			headers: new HttpHeaders({
				'Access-Control-Allow-Origin': '*',
				'Content-Type': 'application/json',
			})
		};
        return this.http.get('https://www.kxip.in/api/flowicsproxy?url=https://live.flowics.com/api/content/0.2/flows/d0184b7bd3e021a4b557d6cb2d33a6ec/posts', httpOptions).toPromise();
    }

}

