mirror of
https://github.com/R0m1k3/CollectFlow.git
synced 2026-10-17 04:09:39 +02:00
fix(ai): persist openrouter settings on server and fix 503 error
This commit is contained in:
1 parent
643b26dcf3
commit
c41a60b430
3 files changed
+34
-18
No files matched your search
@@ -9,6 +9,8 @@ const CONFIG_FILE = path.join(DATA_DIR, ".db-config.json");
|
||||
|
||||
export interface DbConfig {
|
||||
url: string;
|
||||
openRouterKey?: string;
|
||||
openRouterModel?: string;
|
||||
}
|
||||
|
||||
export async function testDatabaseConnection(url: string) {
|
||||
@@ -32,9 +34,9 @@ export async function testDatabaseConnection(url: string) {
|
||||
}
|
||||
}
|
||||
|
||||
export async function saveDatabaseSettings(url: string) {
|
||||
export async function saveDatabaseSettings(url: string, openRouterKey?: string, openRouterModel?: string) {
|
||||
try {
|
||||
const config: DbConfig = { url };
|
||||
const config: DbConfig = { url, openRouterKey, openRouterModel };
|
||||
|
||||
// S'assurer que le dossier data existe
|
||||
await fs.mkdir(DATA_DIR, { recursive: true });
|
||||
|
||||
Reference in new issue
Block a user