Skip to content

Commit 7aff21e

Browse files
committed
fix(config): make photo url configurable
1 parent 83aba6d commit 7aff21e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

next.config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
import type { NextConfig } from "next";
22
import createNextIntlPlugin from "next-intl/plugin";
3+
import type { RemotePattern } from "next/dist/shared/lib/image-config";
34

5+
const photoUrl = new URL(
6+
process.env.NEXT_PUBLIC_PHOTO_URL ?? "https://api.eventownik.solvro.pl",
7+
);
48
const nextConfig: NextConfig = {
59
images: {
610
remotePatterns: [
711
{
8-
protocol: "https",
9-
hostname: "api.eventownik.solvro.pl",
10-
},
12+
protocol: photoUrl.protocol.replace(/:$/, ""),
13+
hostname: photoUrl.hostname,
14+
} as RemotePattern,
1115
{
1216
protocol: "https",
1317
hostname: "www.gravatar.com",

0 commit comments

Comments
 (0)