To upload the image to our server, we are using postFile() on VisionAPIService. Let's create this service now. Inside the client\app\services folder, create a file named vision.api.service.ts and update it as follows:
// SNIPP SNIPPimport { Injectable } from '@angular/core';import { HttpClient } from '@angular/common/http';import { Observable } from 'rxjs/Observable';@Injectable()export class VisionAPIService { constructor(private http: HttpClient) {} postFile(threadId: string, fileToUpload: File): Observable < any > { const formData: FormData = new FormData(); formData.append('image-reply', fileToUpload, fileToUpload.name); return this.http.post < any > (`/api/upload-image/${threadId}`, formData); }}// SNIPP ...