chore: add db dependency and check for env DB_URL
This commit is contained in:
parent
082bd78bf7
commit
ff267f7530
3 changed files with 6 additions and 0 deletions
|
|
@ -15,6 +15,7 @@
|
||||||
"preset": "@repo/jest-presets/node"
|
"preset": "@repo/jest-presets/node"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@repo/db": "*",
|
||||||
"@repo/logger": "*",
|
"@repo/logger": "*",
|
||||||
"body-parser": "^1.20.3",
|
"body-parser": "^1.20.3",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clerk/nextjs": "^6.22.0",
|
"@clerk/nextjs": "^6.22.0",
|
||||||
"@repo/logger": "*",
|
"@repo/logger": "*",
|
||||||
|
"@repo/db": "*",
|
||||||
"@repo/ui": "*",
|
"@repo/ui": "*",
|
||||||
"next": "^15.3.0",
|
"next": "^15.3.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@ import dotenv from "dotenv";
|
||||||
dotenv.config({ path: ".env" });
|
dotenv.config({ path: ".env" });
|
||||||
|
|
||||||
let db_url = process.env.DATABASE_URL!;
|
let db_url = process.env.DATABASE_URL!;
|
||||||
|
if (!db_url) {
|
||||||
|
throw new Error("DATABASE_URL is not set in environment variables.");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
db_url = decodeURI(db_url);
|
db_url = decodeURI(db_url);
|
||||||
} catch {
|
} catch {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue