image icon indicating copy to clipboard operation
image copied to clipboard

External hosted IPX

Open jeanmatthieud opened this issue 3 years ago • 4 comments

Hi,

I want to be able to use an IPX provider, but with an IPX instance hosted on another server than the one running Nuxt. Currently, the IPX provider source code uses the nuxt context.base URL, and cannot be changed :

/src/runtime/providers/ipx.ts:29

url: joinURL(nuxtBase, baseURL, params, encodePath(src))

I would like to be able to change the base URL (http(s)://xxxx) of the server running the IPX instance.

jeanmatthieud avatar Feb 04 '22 10:02 jeanmatthieud

Moreover, the base property doesn't exists on ImageCTX::nuxtContext

export interface ImageCTX {
  options: CreateImageOptions,
  nuxtContext: {
    ssrContext: any
    cache?: any
    isDev: boolean
    isStatic: boolean
    nuxtState?: any
  }
  $img?: $Img
}

jeanmatthieud avatar Feb 04 '22 10:02 jeanmatthieud

Hosting your own IPX instance (https://github.com/unjs/ipx) means you're creating a custom provider, therefore you might need to take a look at https://image.nuxtjs.org/advanced/custom-provider

treboryx avatar Feb 05 '22 10:02 treboryx

I believe that after merging ma correction, it will be possible to use the existing IPX provider, but with an external baseURL.

jeanmatthieud avatar Feb 07 '22 07:02 jeanmatthieud

This is linked to #339

jeanmatthieud avatar Jun 10 '22 08:06 jeanmatthieud