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
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue