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

@ -15,6 +15,7 @@
"preset": "@repo/jest-presets/node"
},
"dependencies": {
"@repo/db": "*",
"@repo/logger": "*",
"body-parser": "^1.20.3",
"cors": "^2.8.5",

View file

@ -14,6 +14,7 @@
"dependencies": {
"@clerk/nextjs": "^6.22.0",
"@repo/logger": "*",
"@repo/db": "*",
"@repo/ui": "*",
"next": "^15.3.0",
"react": "^18.3.1",

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 {