chore: add db dependency and check for env DB_URL

This commit is contained in:
afiqzudinhadi 2025-07-08 22:44:33 +08:00
parent 082bd78bf7
commit ff267f7530
3 changed files with 6 additions and 0 deletions

View file

@ -4,6 +4,10 @@ import dotenv from "dotenv";
dotenv.config({ path: ".env" });
let db_url = process.env.DATABASE_URL!;
if (!db_url) {
throw new Error("DATABASE_URL is not set in environment variables.");
}
try {
db_url = decodeURI(db_url);
} catch {