import ky from 'ky-universal' ; const prefixUrl = `${ process . env . HOST }:${ process . env . PORT }` ; export default class HttpClient { public async get < T > ( url ) { return ky . get ( url , { prefixUrl } ) . json ( ) ; } public async post < T > ( url , data ? ) { return ky . post ( url , { prefixUrl , json : data } ) . json ( ) ; } public async put < T > ( url , data ? ) { return ky . put ( url , { prefixUrl , json : data } ) . json ( ) ; } public async delete < T > ( url ) { return ky . delete ( url , { prefixUrl } ) . json ( ) ; } }