import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Post } from '../core/entities';

@Injectable()
export class HomeService {

	constructor(private http: HttpClient) {}

	getLastPosts(): Observable<Array<Post>> {
		return this.http.get<Array<Post>>('/api/posts/last');
	}
}
