Skip to content

Commit 3cbf499

Browse files
committed
fix: hardcode directus url
1 parent 62b4085 commit 3cbf499

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

app/src/components/DirectusImage.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
import { DIRECTUS_URL } from "@/directus";
12
import { components } from "@/types/schema";
23
import Image, { ImageLoader } from "next/image";
34

45
const imageLoader: ImageLoader = ({ src, width, quality }) => {
5-
return `${process.env.NEXT_PUBLIC_DIRECTUS_URL}/assets/${src}?width=${width}`;
6+
return `${DIRECTUS_URL}/assets/${src}?width=${width}`;
67
};
78

89
/**

app/src/directus.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {
1010
} from "@directus/sdk";
1111
import { GetServerSideProps, GetServerSidePropsContext } from "next";
1212

13+
export const DIRECTUS_URL = "https://clic.epfl.ch/directus";
14+
1315
/**
1416
* Creates a handle to use Directus' API. See the [official documentation](https://docs.directus.io/guides/sdk/getting-started.html).
1517
*
@@ -18,7 +20,7 @@ import { GetServerSideProps, GetServerSidePropsContext } from "next";
1820
* @returns a handle to Directus' API.
1921
*/
2022
export const directus = () =>
21-
createDirectus<Schema>(process.env.DIRECTUS_URL || "")
23+
createDirectus<Schema>(DIRECTUS_URL)
2224
.with(staticToken(process.env.DIRECTUS_TOKEN || ""))
2325
.with(rest());
2426

0 commit comments

Comments
 (0)