Skip to content

Next.js, Storybook, images from external source #136

Discussion options

You must be logged in to vote

Hi Andreas,

First question

Regarding your first question, I see two approaches:

a) Writing a Next.js API Route providing a proxy feature like res.cloudinary.com

  • receives a image resource URL
  • load the resource
  • pass the resource via response back to the client

This example might push you into the right direction:
https://maxschmitt.me/posts/next-js-api-proxy/

b) Trying out a new experimental (!) Next.js config. I haven't used this before, but you could try to set ** for hostname and pathname.

https://nextjs.org/docs/api-reference/next/image#remote-patterns

Second question:

If you want to use Next.js components outside of a Next.js application (like Storybook), you need to write a mock in …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by UniversalTraveller
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
2 participants