Files
StevenandGitHub aaf28ab51c chore(example): add example for image optimization with secure compute (#72641)
This PR adds a new example that shows a more complex use case where you
don't want browser to know about the upstream image server so instead
you can proxy through a serverless function.

Some use cases might be checking for an IP address, user agent, etc.
2024-11-13 11:51:01 -05:00

8 lines
229 B
TypeScript

import Image, { ImageProps } from "next/image";
export function SecureImage(props: ImageProps) {
const src =
typeof props.src === "string" ? `/image-api${props.src}` : props.src;
return <Image {...props} src={src} />;
}