From d473a298ee5c6ab04708550149fee9f3f9a93f30 Mon Sep 17 00:00:00 2001 From: ydennisy Date: Sun, 19 Nov 2023 16:55:25 +0000 Subject: [PATCH] chore: add prod URL if .env is missing --- cli/src/add.ts | 3 ++- cli/src/chat.ts | 3 ++- cli/src/search.ts | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/src/add.ts b/cli/src/add.ts index 93c2a0e..37d6332 100644 --- a/cli/src/add.ts +++ b/cli/src/add.ts @@ -7,7 +7,8 @@ interface Node { type: 'NOTE' | 'WEB_PAGE'; } -const BASE_URL = process.env.BASE_URL; +const BASE_URL = + process.env.BASE_URL || 'https://kg1-backend-j5dxapaafq-ew.a.run.app'; const add = async (raw: string): Promise => { try { diff --git a/cli/src/chat.ts b/cli/src/chat.ts index 986341c..24c69fb 100644 --- a/cli/src/chat.ts +++ b/cli/src/chat.ts @@ -1,7 +1,8 @@ import axios from 'axios'; import chalk from 'chalk'; -const BASE_URL = process.env.BASE_URL; +const BASE_URL = + process.env.BASE_URL || 'https://kg1-backend-j5dxapaafq-ew.a.run.app'; const chat = async (query: string) => { try { diff --git a/cli/src/search.ts b/cli/src/search.ts index cafcc53..83d69e6 100644 --- a/cli/src/search.ts +++ b/cli/src/search.ts @@ -1,7 +1,8 @@ import axios from 'axios'; import chalk from 'chalk'; -const BASE_URL = process.env.BASE_URL; +const BASE_URL = + process.env.BASE_URL || 'https://kg1-backend-j5dxapaafq-ew.a.run.app'; const search = async (q: string): Promise => { try {