From 36b3ec9474e7429d526038ada579c84b513c938b Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Wed, 18 Oct 2023 03:10:01 -0700 Subject: [PATCH] endpoint error fixed --- src/routes/+page.server.ts | 2 +- src/routes/+page.svelte | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/+page.server.ts b/src/routes/+page.server.ts index d416524cc..c4559b060 100644 --- a/src/routes/+page.server.ts +++ b/src/routes/+page.server.ts @@ -20,6 +20,6 @@ export const load: PageServerLoad = async ({ url }) => { return { models: models?.models ?? [], - ENDPOINT: ENDPOINT + OLLAMA_ENDPOINT: process.env.OLLAMA_ENDPOINT }; }; diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index c061054c3..428a23178 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -11,9 +11,12 @@ import { onMount, tick } from 'svelte'; import { openDB, deleteDB } from 'idb'; + import { ENDPOINT as SERVER_ENDPOINT } from '$lib/contants'; export let data: PageData; - $: ({ models, ENDPOINT } = data); + $: ({ models, OLLAMA_ENDPOINT } = data); + + const ENDPOINT = OLLAMA_ENDPOINT ? OLLAMA_ENDPOINT : SERVER_ENDPOINT; let textareaElement; let db;