fix: make env dynamic

This commit is contained in:
Rotimi Best
2024-09-20 11:16:19 +01:00
parent 4199fce976
commit 2a50b22ad2
12 changed files with 41 additions and 43 deletions
@@ -1,7 +1,7 @@
import { json } from '@sveltejs/kit';
import { UNSPLASH_API_KEY } from '$env/static/private';
import { env } from '$env/dynamic/private';
const UNSPLASH_API_URL = `https://api.unsplash.com/search/photos?page=2&per_page=15&auto=format&fit=crop&w=2970&q=80&client_id=${UNSPLASH_API_KEY}`;
const UNSPLASH_API_URL = `https://api.unsplash.com/search/photos?page=2&per_page=15&auto=format&fit=crop&w=2970&q=80&client_id=${env.UNSPLASH_API_KEY}`;
// API to fetch photos from Unsplash
export async function POST({ request }) {