Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External hosted IPX #483

Closed
jeanmatthieud opened this issue Feb 4, 2022 · 4 comments
Closed

External hosted IPX #483

jeanmatthieud opened this issue Feb 4, 2022 · 4 comments

Comments

@jeanmatthieud
Copy link
Contributor

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 jeanmatthieud changed the title External IPX External hosted IPX Feb 4, 2022
@jeanmatthieud
Copy link
Contributor Author

jeanmatthieud commented Feb 4, 2022

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 added a commit to jeanmatthieud/image that referenced this issue Feb 4, 2022
@treboryx
Copy link
Contributor

treboryx commented Feb 5, 2022

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

@jeanmatthieud
Copy link
Contributor Author

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

@jeanmatthieud
Copy link
Contributor Author

This is linked to #339

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants