data endpoint for entity 90008 (aka. a website)
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: pull env vars from dynamic

dusk 5d466eb1 75dc3783

+5 -5
+2 -2
src/lib/index.ts
··· 1 1 import type { Cookies } from '@sveltejs/kit' 2 - import { WEBSITE_DATA_DIR } from '$env/static/private' 2 + import { env } from '$env/dynamic/private' 3 3 import { existsSync, readFileSync } from 'fs' 4 4 import { writable } from 'svelte/store' 5 5 ··· 17 17 } 18 18 } 19 19 20 - export const visitCountFile = `${WEBSITE_DATA_DIR}/visitcount` 20 + export const visitCountFile = `${env.WEBSITE_DATA_DIR}/visitcount` 21 21 export const visitCount = writable(parseInt(existsSync(visitCountFile) ? readFileSync(visitCountFile).toString() : '0'));
+3 -3
src/routes/guestbook/+page.server.ts
··· 1 - import { GUESTBOOK_BASE_URL } from '$env/static/private' 1 + import { env } from '$env/dynamic/private' 2 2 import { redirect, type Cookies } from '@sveltejs/kit' 3 3 import auth from '$lib/guestbookAuth' 4 4 import { scopeCookies as _scopeCookies } from '$lib'; ··· 90 90 } 91 91 // set content, make sure to trim it 92 92 postData.set('content', content.substring(0, 512).trim()) 93 - respRaw = await fetch(GUESTBOOK_BASE_URL, { method: 'POST', body: postData }) 93 + respRaw = await fetch(env.GUESTBOOK_BASE_URL, { method: 'POST', body: postData }) 94 94 } catch (err: any) { 95 95 scopedCookies.set("sendError", `${err.toString()} (is guestbook server running?)`) 96 96 redirect(303, auth.callbackUrl) ··· 111 111 try { 112 112 const count = 5 113 113 const offset = (data.page - 1) * count 114 - respRaw = await fetch(`${GUESTBOOK_BASE_URL}?offset=${offset}&count=${count}`) 114 + respRaw = await fetch(`${env.GUESTBOOK_BASE_URL}?offset=${offset}&count=${count}`) 115 115 } catch (err: any) { 116 116 data.getError = `${err.toString()} (is guestbook server running?)` 117 117 return data