forked from open-webui/open-webui
		
	endpoint error fix
This commit is contained in:
		
							parent
							
								
									c5e36c8d11
								
							
						
					
					
						commit
						ecb4d1b8d9
					
				
					 2 changed files with 16 additions and 14 deletions
				
			
		|  | @ -2,13 +2,18 @@ import { ENDPOINT } from '$lib/contants'; | |||
| import type { PageServerLoad } from './$types'; | ||||
| 
 | ||||
| export const load: PageServerLoad = async ({ url }) => { | ||||
| 	const models = await fetch(`${ENDPOINT}/api/tags`, { | ||||
| 		method: 'GET', | ||||
| 		headers: { | ||||
| 			Accept: 'application/json', | ||||
| 			'Content-Type': 'application/json' | ||||
| 	const OLLAMA_ENDPOINT = process.env.OLLAMA_ENDPOINT; | ||||
| 	console.log(OLLAMA_ENDPOINT); | ||||
| 	const models = await fetch( | ||||
| 		`${OLLAMA_ENDPOINT != undefined ? OLLAMA_ENDPOINT : ENDPOINT}/api/tags`, | ||||
| 		{ | ||||
| 			method: 'GET', | ||||
| 			headers: { | ||||
| 				Accept: 'application/json', | ||||
| 				'Content-Type': 'application/json' | ||||
| 			} | ||||
| 		} | ||||
| 	}) | ||||
| 	) | ||||
| 		.then(async (res) => { | ||||
| 			if (!res.ok) throw await res.json(); | ||||
| 			return res.json(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Timothy J. Baek
						Timothy J. Baek