NextJS Fetching an image that statically served from a microservice

Hey all. There's a Java backend that's hosting some images. I would like to have a nextJS api route that's going to fetch an image from there and then return it so the NextJS client can use it. Right now I'm doing:
const imageRes = await apiFetch(apiURL)

const imageRes = await apiFetch(apiURL)

So far so good but imageRes is still a promise (as the name implies). I want to return the actual image but .json() doesn't work because it's an image and can't be converted into a JS object Any ideas how I can go about this one ?
1 Reply
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server