1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-14 06:32:36 +01:00

🐛 fix windows db file path

This commit is contained in:
Flam3rboy 2021-10-05 19:32:29 +02:00
parent efe9fdc9fe
commit 2dd50e757b

View File

@ -14,7 +14,7 @@ let dbConnectionString = process.env.DATABASE || path.join(process.cwd(), "datab
export function initDatabase(): Promise<Connection> { export function initDatabase(): Promise<Connection> {
if (promise) return promise; // prevent initalizing multiple times if (promise) return promise; // prevent initalizing multiple times
const type = dbConnectionString.includes(":") ? dbConnectionString.split(":")[0]?.replace("+srv", "") : "sqlite"; const type = dbConnectionString.includes("://") ? dbConnectionString.split(":")[0]?.replace("+srv", "") : "sqlite";
const isSqlite = type.includes("sqlite"); const isSqlite = type.includes("sqlite");
console.log(`[Database] ${yellow(`connecting to ${type} db`)}`); console.log(`[Database] ${yellow(`connecting to ${type} db`)}`);