Skip to content

Commit

Permalink
revert: image proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
ythepaut committed Sep 16, 2024
1 parent c9f31ca commit 4c5fc8c
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ IMAGES_URL=http://showcase.ythepaut.com/assets/images.json
TIMEZONE=Europe/Paris
DEFAULT_LOCALE=fr

IMAGE_HOSTNAME_PATTERNS=localhost,*.ythepaut.com
IMAGE_HOSTNAME_PATTERNS=*.ythepaut.com
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ IMAGES_URL=http://localhost:3000/assets/images_test.json
TIMEZONE=Europe/Paris
DEFAULT_LOCALE=fr

IMAGE_HOSTNAME_PATTERNS=localhost,placehold.co
IMAGE_HOSTNAME_PATTERNS=placehold.co
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Choose one of the following methods:
# Your timezone and default locale (only fr and en are supported)
TIMEZONE=Europe/Paris
DEFAULT_LOCALE=fr

# Comma separated patterns to the image hosts (e.g. cdn.mydomain.com, placehold.co, *.pixabay.com)
IMAGE_HOSTNAME_PATTERNS=
```
Expand Down
2 changes: 1 addition & 1 deletion src/components/details/ImageCarousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function ImageCarousel({ selectedImageId, images }: Readonly<Prop
passHref>
<NextImage
className="object-cover w-full h-full rounded-50"
src={`/api/image?url=${encodeURIComponent(image.src)}`}
src={image.src}
alt={image.title}
width={image.width}
height={image.height}
Expand Down
4 changes: 2 additions & 2 deletions src/components/details/ImageViewer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default function ImageViewer({ image }: Readonly<Props>): ReactElement {
});
bp.open({
items: [{
img: `/api/image?url=${encodeURIComponent(image.src)}`,
thumb: `/api/image?url=${encodeURIComponent(image.src)}`,
img: image.src,
thumb: image.src,
width: image.width,
height: image.height,
alt: image.title
Expand Down
2 changes: 1 addition & 1 deletion src/components/gallery/ImageTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default function ImageTile({ image }: Readonly<Props>): ReactElement {
<div className="relative group">
<NextImage
className="w-full rounded-50 cursor-pointer"
src={`/api/image?url=${encodeURIComponent(image.src)}`}
src={image.src}
alt={image.title}
width={image.width}
height={image.height}
Expand Down
25 changes: 0 additions & 25 deletions src/pages/api/image.ts

This file was deleted.

0 comments on commit 4c5fc8c

Please sign in to comment.