import { env } from "bun"; import { BotApiResponse } from "src/types/BotApiResponse"; class BotApiService { readonly BOT_API_URI = env.BOT_API_URI; async getAll(): Promise { const get_url = `${this.BOT_API_URI}/images`; const response: BotApiResponse = await fetch(get_url) .then(res => { if (!res.ok) { throw new Error("Error fetching images"); } else { return res.json(); } }) as BotApiResponse; return response; } } export default new BotApiService();