Make Qwen OAuth work on Vercel
This commit is contained in:
7
app/api/ollama/constants.ts
Normal file
7
app/api/ollama/constants.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export const DEFAULT_OLLAMA_BASE = process.env.NEXT_PUBLIC_OLLAMA_ENDPOINT || process.env.OLLAMA_ENDPOINT || "https://ollama.com";
|
||||
export function normalizeOllamaBase(url?: string): string {
|
||||
if (!url) return DEFAULT_OLLAMA_BASE.replace(/\/$/, "");
|
||||
const trimmed = url.trim();
|
||||
if (!trimmed) return DEFAULT_OLLAMA_BASE.replace(/\/$/, "");
|
||||
return trimmed.replace(/\/$/, "");
|
||||
}
|
||||
Reference in New Issue
Block a user